目前我的UIView
大小为100px宽,40px高。如果我使用
[self.view addSubView:buttonsView];
它将这个小小的UIVIew添加到iPhone屏幕的左上角。
有没有办法让它添加到右下角呢?
答案 0 :(得分:11)
在添加buttonView之前,设置其“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 );