如何在XCode界面构建器中更改默认色调颜色?

时间:2015-08-03 19:44:23

标签: ios xcode interface-builder

如何在XCode界面构建器中更改全局默认色调颜色?

enter image description here

5 个答案:

答案 0 :(得分:25)

Utility 面板的文件检查器选项卡中,右侧的,您可以找到有关大小类,自动布局和故事板的全局色调的控件。< / p>

enter image description here

答案 1 :(得分:3)

界面生成器方式: 选择要设置默认色调的Storyboard或Xib文件。

然后在第一个选项卡上的Utilities中,File Inspector查找Interface Builder Document部分,您将看到如下图所示的Global Tint。

(发布图片的声誉不够)

enter image description here

<强>编程

的OBJ-C:     [[[[UIApplication sharedApplication] delegate] window] setTintColor:[UIColor orangeColor]];

夫特: UIWindow(frame: UIScreen.mainScreen().bounds).tintColor = UIColor.orangeColor()

答案 2 :(得分:0)

您可以为整个窗口设置默认色调颜色:

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
        window = UIWindow(frame: UIScreen.mainScreen().bounds)
        window?.tintColor = UIColor(red: 1, green: 0, blue: 0, alpha: 1)
        return true
}

答案 3 :(得分:0)

如果您打开本地化,这似乎不起作用。全球色彩消失

答案 4 :(得分:-1)

您可以使用以下设置默认外观设置:

    <logic:equal name="readOnly" value="false">
<tr class="item_snippet editorLink">
    <td class="editable col_description"><div class="static-text"></div>
        <input class="edit-field" name="description" maxlength="100" placeholder="<bean:message key="rootcause.text.addRootCause"/>"/></td>
    <td class="editable col_typeID"><div class="static-text"></div>
        <logic:notEmpty name="rootCauseTypeListing">
        <select class="edit-field" name="typeID">
        <logic:iterate id="type" name="rootCauseTypeListing">
        <option value="<bean:write name="type" property="key"/>"><bean:write name="type" property="value"/></option>
        </logic:iterate>
        </select></logic:notEmpty></td>
    <td></td>

this.setItemEvents = function(o){
        o.addEvents({
            'mouseover': function(){
                o.addClass('hover');
                if (oToolbar){
                    instance.showInlineToolBar(o);
                }
            },
            'mouseout': function(e){
                if (e.relatedTarget == oToolbar){ return;}
                o.removeClass('hover');
                if (oToolbar){
                    instance.hideInlineToolBar(o);
                }
            },
            'click': function(e){
                o.addClass('hover');
            }
        });

        o.getChildren('td.editable').each(function(td){
            var t = td.getFirst('.'+class_staticText);
            var f = td.getFirst('.'+class_editField);

            // date picker fields initial setting: display dateClone instead of static text
            /*
            if (f && f.hasClass(class_datePicker)){
                var dateClone = f.getNext('.' + class_datePicker);
                t.setStyle('display', 'none');
                dateClone.setStyle('display', 'block');
            }*/

            // general events
            td.addEvents({
                'mouseover': function(){
                    td.addClass('hover');
                    td.setStyle('cursor', 'text');
                },
                'mouseout': function(e){
                    //if (e.relatedTarget == oToolbar){ return;}
                    td.removeClass('hover');
                },
                'click': function(e){
                    instance.onEditMode(td);
                    e.stopPropagation();
                },
                'keydown': function(e){
                    instance.setTabMove(e, td);
                }
            });
        });

如果你把它放在:

UIButton.appearance().tintColor = UIColor.orangeColor()

只有它适用于整个应用程序。除非你在链中降低它,即在UIViewController的

application:didFinishLaunchingWithOptions: