【问题标题】:Change width of UIImageView改变 UIImageView 的宽度
【发布时间】:2010-04-02 00:58:07
【问题描述】:

如何在 Objective-c 中仅更改 UIImageView 的宽度?目前我正在这样做:

imageview.frame = GCRectMake(x,y,width,height);

但是当我改变宽度时,它似乎只是改变了位置而不是改变了大小。

【问题讨论】:

    标签: iphone objective-c


    【解决方案1】:

    试试这个:

    CGRect frame = [imageView frame];
    frame.size.width = newWidth;
    [imageView setFrame:frame];
    

    【讨论】:

      猜你喜欢
      • 2010-11-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-10-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多