我想将 UIButton 固定到 iPhone 屏幕的右下角。3.5英寸和4英寸屏幕。
这是我写的代码。但在 iPhone4 和 iPhone5 中,按钮始终保持在 x=265,y=361 上。
UIImage* plusImage = [UIImage imageNamed:@"Plus.png"];
UIButton* plusButton = [UIButton buttonWithType:UIButtonTypeCustom];
[plusButton setImage:plusImage forState:UIControlStateNormal];
[plusButton setFrame:CGRectMake(265, 361, plusImage.size.width, plusImage.size.height)];
plusButton.autoresizingMask = UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleLeftMargin;
[self.view addSubview:plusButton];
我已经将自动调整大小的蒙版设置为灵活的顶部和左侧边距。但它没有用。我错过了什么?请帮忙。