【问题标题】:Objective C - change arrangement of UIImageviewObjective C - 改变 UIImageview 的排列
【发布时间】:2011-12-15 03:23:27
【问题描述】:

我在我的代码中创建了一个UIImageView

UIImageView *background = [[UIImageView alloc]initWithFrame:CGRectMake(150, 60, 180, 180)];
[self.view addSubview:background];

我的 XIB 中还有一个 UIImageView。以编程方式创建的UIImageView 出现在XIB 的UIImageView 之上。如何更改此设置以使 XIB 的 UIImageView 出现在顶部?

【问题讨论】:

    标签: objective-c cocoa-touch interface-builder uiimageview xib


    【解决方案1】:

    通常我会将背景直接放在 nib 文件中。但要以编程方式添加,请使用insertSubview:belowSubview:insertSubview:atIndex:sendSubviewToBack: 将其放在您想要的位置。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-02-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多