简体   繁体   English

如何在iPhone中创建半透明按钮?

[英]How to create a translucent button in iphone?

I am new to iphone development.I want to create a translucent button with the text "exit".How can i create it? 我是iPhone开发的新手。我想创建一个带有文本“ exit”的半透明按钮。如何创建它? Thanks. 谢谢。

You can also use Interface Builder and not have to fiddle with PNG transparency. 您也可以使用Interface Builder,而不必摆弄PNG透明度。

On the "Attributes" pane for that "custom"-type button, the "View" subpane has an "Alpha" slider. 在该“自定义”类型按钮的“属性”窗格上,“视图”子窗格具有“ Alpha”滑块。 Set that to (for example) 0.50 to make it translucent. 将其设置为(例如)0.50以使其半透明。 Set the "Title" in the configuration to "exit". 在配置中将“标题”设置为“退出”。 Done. 做完了

Please create .png image with Translucent effect and "exit" text on that image. 请创建具有半透明效果的.png图像,并在该图像上“退出”文本。

Once you have image ready create Custom UIButton and set image for that button. 准备好图像后,创建Custom UIButton并为该按钮设置图像。

Thanks, 谢谢,
Jim. 吉姆

the .png format supports alpha transparency (which you can set in the graphics app you use to make the button). .png格式支持Alpha透明度(您可以在用于制作按钮的图形应用中进行设置)。 For more info on iPhone graphics, see the iPhone OS ref . 有关iPhone图形的更多信息,请参阅iPhone OS参考

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM