Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/42.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone 如何在UIViewContentModeCenter中调整UIView的大小?_Iphone_Xcode_Uiview_Size - Fatal编程技术网

Iphone 如何在UIViewContentModeCenter中调整UIView的大小?

Iphone 如何在UIViewContentModeCenter中调整UIView的大小?,iphone,xcode,uiview,size,Iphone,Xcode,Uiview,Size,我不明白。我正在使用UIView而不是imageView。如何在UIViewContentModeScaleAspectFit或UIViewContentModeCenter中调整对象窗体“UIView”的大小?我试过这个 ObjectUIview.contentMode = UIViewContentModeCenter; 它不起作用。但它在imageview而不是UIview上工作。我试图使窗口看起来像gui。我不能让UIview全屏和普通版合身。有人能帮我吗 //

我不明白。我正在使用UIView而不是imageView。如何在UIViewContentModeScaleAspectFit或UIViewContentModeCenter中调整对象窗体“UIView”的大小?我试过这个

ObjectUIview.contentMode = UIViewContentModeCenter;
它不起作用。但它在imageview而不是UIview上工作。我试图使窗口看起来像gui。我不能让UIview全屏和普通版合身。有人能帮我吗

            //---single tap---

            case 1: {
                //ObjectUIview.contentMode = UIViewContentModeScaleAspectFit;
                imageView.contentMode = UIViewContentModeScaleAspectFit;

            } break;



            //---double tap---

            case 2: {
                //ObjectUIview.contentMode = UIViewContentModeCenter;
                imageView.contentMode = UIViewContentModeCenter;

            } break;

定义“它不起作用”。怎么搞的?你期望发生什么?另外,检查文档中的contentMode,确保它与你认为的一样:定义“它不工作”。怎么搞的?您预期会发生什么?另外,请检查文档中的contentMode,并确保它与您认为的一样: