UIImageView change Width and Height

后端 未结 8 746
-上瘾入骨i
-上瘾入骨i 2021-02-13 10:12

I\'ve read various posts on here asking similar questions... I\'ve tried various ways that were posted including bounds and frames etc. including the following:



        
8条回答
  •  有刺的猬
    2021-02-13 10:56

    Try Using a UIScrollView. Add the UIImageView to the UIScrollView in Interface Builder you can then control the position and size of the image as follows:

        CGRect rect = [scrollView frame];
    
        rect.origin.x = 50.0f;
        rect.origin.y = 0.0f;
        rect.size.width = 320.0f;
        rect.size.height = 150.0f;
    
        [scrollView setFrame:rect];
    

提交回复
热议问题