开发者

Design a button with Image on top of Title

In order to make my buttons big and square rahter than rectangle, so that they are easier to touch, I want to display the Image on top of the Title, and not on the le开发者_开发百科ft.

I can't see any option in Interface Builder 3.2.4 to do that.

Is there any trick to achieve this?

Thanks!


I found a workaround. Since there is not the option for positionning the image relatively from the text, i did as follows:

Property LineBreaks:

  • Clip

Property Content:

  • H. Alignment: Left
  • V. Alignment: Middle

Property "Title Edge Insert" of the button:

  • Left: 31
  • Top: -15
  • Right: 0
  • Bottom: 0

Property "Image Edge Insert" of the button:

  • Left: -20
  • Top: 35
  • Right: 0
  • Bottom: 0

You probably need to adjust the values depending on the size of your button, your image and your test...


Try to keep a imageView with your image and add that imageview as your subview to the button.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜