Iphone 将UIVIew作为子视图添加到窗口的右下角
目前我有一个Iphone 将UIVIew作为子视图添加到窗口的右下角,iphone,ios,Iphone,Ios,目前我有一个UIView,大小为100px宽,40px高。如果我使用 [self.view addSubView:buttonsView] 它将这个小视图添加到我的iPhone屏幕的左上角 是否有办法将其添加到右下角?在添加按钮视图之前,请设置其“frame”属性: 单向: buttonsView.frame = CGRectMake( self.view.frame.size.width - buttonsView.frame.size.width, self.view.frame.si
UIView
,大小为100px宽,40px高。如果我使用
[self.view addSubView:buttonsView]代码>
它将这个小视图添加到我的iPhone屏幕的左上角
是否有办法将其添加到右下角?在添加按钮视图之前,请设置其“frame”属性:
单向:
buttonsView.frame = CGRectMake(
self.view.frame.size.width - buttonsView.frame.size.width,
self.view.frame.size.height - buttonsView.frame.size.height,
buttonsView.frame.size.width,
buttonsView.frame.size.height );
或者使用autoresizingMask。。还有烦人的算术。。