草庐IT

UIbuttons

全部标签

ios - CALayer - 将子层放在 Storyboard UIButtons 下方?

我的Storyboard中有一个带有多个UIButton的ViewController。其中之一激活子层中显示的AVFoundation相机预览层:captureVideoPreviewLayer=[[AVCaptureVideoPreviewLayeralloc]initWithSession:session];captureVideoPreviewLayer.frame=self.view.bounds;[self.view.layeraddSublayer:captureVideoPreviewLayer];除了预览层呈现在我的按钮之上之外,这工作正常,因此即使按钮仍然可点击,用

ios - UIScrollView 底部的 UIButtons 不起作用

我在Storyboard中创建了一个UIScrollView,并在UIScrollView内的容器View中添加了12个UIButton。在iPhone5s模拟器上运行时,屏幕上可以看到9个按钮,其余按钮只有向下滚动才能看到。最初可以在屏幕上看到的9个按钮可以进行交互。但是,无法与ScrollView底部的3个按钮(必须滚动到它们才能看到)进行交互。我在iPhone6模拟器上运行该应用程序,无需滚动即可在屏幕上显示所有12个按钮,底部的3个按钮可以使用。我正在使用自动布局。我试过摆弄UIScrollView的contentSize,但无济于事。 最佳答案

objective-c - 是否可以更改 UIButtons 背景颜色?

这个让我难过。是否可以在CocoaforiPhone中更改UIButton的背景颜色。我试过设置背景颜色,但它只会改变角落。setBackgroundColor:似乎是处理此类事情的唯一方法。[randomsetBackgroundColor:[UIColorblueColor]];[random.titleLabelsetBackgroundColor:[UIColorblueColor]]; 最佳答案 这可以通过制作副本以编程方式完成:loginButton=[UIButtonbuttonWithType:UIButtonTyp