Xcode 5 中没有圆形矩形按钮?

No Round Rect Button in Xcode 5?(Xcode 5 中没有圆形矩形按钮?)
本文介绍了Xcode 5 中没有圆形矩形按钮?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Xcode 5 中是否不再提供圆形矩形按钮的拖放功能?我似乎在 Interface Builder 中找不到它.我猜这是 iOS 7 的变化之一,但我只是想确认一下.

Is drag and drop of round rect button no longer available in Xcode 5? I can't seem to find it in the Interface Builder. I was guessing that this is one of the changes in iOS 7, but I just wanted to make sure.

推荐答案

Xcode 4 和以前版本中的 Round Rect 按钮似乎已替换为 System Default按钮,这也恰好是明确的.IE.默认情况下没有带圆角的白色背景,只有文字可见.

The Round Rect button from Xcode 4 and previous versions appears to have been replaced with the System Default button, which also happens to be clear. I.e. by default there is no white background with rounded corners, only the text is visible.

要使按钮变为白色(或任何其他颜色),请选择属性检查器并向下滚动到 View 部分:

To make the button white (or any other colour), select the attributes inspector and scroll down to the View section:

选择Background并将其更改为白色:

Select Background and change it to White:

如果你想要圆角,你可以用一点代码做到这一点.只需 ctrl-drag 从按钮到您的 .h 文件,将其命名为 roundedButton 并将其添加到您的 viewDidLoad:

If you want rounded corners you can do so with a little bit of code. Just ctrl-drag from the button to your .h file, call it something like roundedButton and add this in your viewDidLoad:

CALayer *btnLayer = [roundedButton layer];
[btnLayer setMasksToBounds:YES];
[btnLayer setCornerRadius:5.0f];

这篇关于Xcode 5 中没有圆形矩形按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Why local notification is not firing for UNCalendarNotificationTrigger(为什么没有为UNCalendarNotificationTrigger触发本地通知)
iOS VoiceOver functionality changes with Bundle Identifier(IOS画外音功能随捆绑包标识符而变化)
tabbar middle tab out of tabbar corner(选项卡栏中间的选项卡角外)
Pushing UIViewController above UITabBar(将UIView控制器推送到UITabBar上方)
How can I sync two flatList scroll position in react native(如何在本机Reaction中同步两个平面列表滚动位置)
Get an event when UIBarButtonItem menu is displayed(显示UIBarButtonItem菜单时获取事件)