[英]Button Hiding the text in iOS6
I have a text box which has a popover. 我有一个带有弹出框的文本框。 Also placed a button on top of the text box to make it clickable so that when button is clicked the popover is opened and any item selected will be shown in the text box. 还要在文本框的顶部放置一个按钮以使其可单击,以便在单击该按钮时打开弹出窗口,并且所选的任何项目都将显示在文本框中。 This is working fine in iOS7 but in iOS 6 i am able to select the item in popover but the button is hiding the text. 这在iOS7中工作正常,但是在iOS 6中,我可以在弹出窗口中选择项目,但是按钮隐藏了文本。 Tried setting colour of button but didn't work. 尝试设置按钮的颜色,但是不起作用。
Please help. 请帮忙。
If you set the type of the button to "Custom", and you don't set an Image or a Background Image, the button will be invisible on versions prior to iOS7 too. 如果将按钮的类型设置为“自定义”,而不设置图像或背景图像,则该按钮在iOS7之前的版本中也将不可见。
If you create the button programmatically: 如果您以编程方式创建按钮:
UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
If you change it on your interface: 如果您在界面上更改它:
Instead of using button, you can open popover by UITextbox
itself. 除了使用按钮,您还可以通过UITextbox
本身打开弹出UITextbox
。 Just place the button's IBAction
code in textbox's IBAction
with EditDidBegin
Event. 只需将按钮的IBAction
代码放入带有EditDidBegin
事件的文本框的IBAction
中EditDidBegin
。
将iOS 6的UIbutton的按钮类型设置为UIButtonTypeCustom
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.