本文介绍了iPhone UIButton - 图像位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 UIButton ,带有文本探索应用程序和 UIImage (>)
Interface Builder 它看起来像:

  [ app] 

但我需要把这个 UIImage 文字后:

  [探索应用程式(>)] 

如何将 UIImage 移动到右边?

解决方案

设置 imageEdgeInset titleEdgeInset 在你的形象。您还可以使用这些全尺寸图形创建一个按钮,并使用它作为按钮的背景图像(然后使用 titleEdgeInsets 移动标题)。


I have a UIButton with text "Explore the app" and UIImage (>)In Interface Builder it looks like:

[ (>) Explore the app ]

But I need to place this UIImage AFTER the text:

[ Explore the app (>) ]

How can I move the UIImage to the right?

解决方案

Set the imageEdgeInset and titleEdgeInset to move the components around within your image. You could also create a button using those graphics that is full size, and use that as the background image for the button (then use titleEdgeInsets to move the title around).

这篇关于iPhone UIButton - 图像位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 04:15