关于这些 UIButton 的问题
我怎样才能获得像这张图片底部的 UIButton (移动和删除)?具体来说,我想要一张带有类似文本的图像。 http://4.bp.blogspot.com/_QLwms0mVa4w/SQN0MqPIpXI/AAAAAAAAAA8/lEikKn9eP_0/s1600-h/Screenshot+2008-10-25+15:31:21+-0400-1。 .png 谢谢。
对于杰森: 图像粘在标签旁边。无论如何,IB 是否可以将其设置为左对齐,而标签右对齐?现在看起来是这样的:
How can I get a UIButton like the ones at the bottom of this picutre (move and delete)? Specifically, I want an image with a text just like that. http://4.bp.blogspot.com/_QLwms0mVa4w/SQN0MqPIpXI/AAAAAAAAAA8/lEikKn9eP_0/s1600-h/Screenshot+2008-10-25+15:31:21+-0400-1.png
Thanks.
For Jason:
The image sticks right beside the label. Is there anyway from IB I can set it to align to the left, while the label aligns to the right? Here's what it looks like right now:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以做的是在 Interface Builder 中,可以将 UIButton 设置为“自定义”类型。
完成此操作后,您可以简单地使用自己的图像作为按钮,并为按钮的每个状态使用不同的图像。
尽管使用这种方法,您将无法像邮件应用程序中的“删除(1)”那样修改其他文本。但是,如果您不需要,那么此解决方案将适合您。
或者,如果您只想将图像粘贴到现有按钮上,那么 Interface Builder 中有一个 Image 属性,您可以在其中将图像粘贴到按钮上。
如果您需要更多功能,那么您可能必须通过子类化来创建自己的 UIButton 来处理它。
What you can do is in Interface Builder, the UIButton can be set to a type of "Custom"
After you have done this, you can simply use your own image for the button and different images for each state of the button.
Although with this approach you won't be able to have additional text modified on it like the mail app has with "Delete (1)". However, if you don't need that then this solution will work for you.
Alternatively, if you just want an image stuck onto your existing button then there is an Image property in Interface Builder where you can slap on an image to your button.
If you need more functionality then you would probably have to create your own UIButton by subclassing to handle it.