我试图在主视图的右下角制作一个正方形 (50 x 50) UIView,但我对为什么它不完全可见感到困惑。在这种情况下,从底部只能看到它的尖端。我混淆了一些概念吗?
CGFloat width = CGRectGetWidth(self.view.bounds); CGFloat height = CGRectGetHeight(self.view.bounds); UIView *transparentFloater = [[UIView alloc] initWithFrame:CGRectMake(width - 50.f, height - 50.0f, 50.0f, 50.0f)]; [self.view addSubview:transparentFloater];
最佳答案
尝试添加自动调整掩码:
transparentFloater.autoresizingMask = UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleLeftMargin;
关于ios - 屏幕边界扩展可见区域,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18821019/