0

尝试增加 iPad 的导航栏

navgroup.height = 80;          

任何人都可以建议我增加 iPad 的导航栏。

4

1 回答 1

1

好吧,Apple 的 iOS 人机界面指南声明“不要以编程方式指定导航栏的高度”。

所以你不能,这在 iPad 上被硬编码为 44dip。

但是,您可以使用自己的自定义渐变制作自己的导航栏视图,只需将其浮动到窗口顶部,这是一个开始,背景渐变和自定义高度为 50px:

var win = Ti.UI.createWindow({
    navBarHidden : true
});
var navBar = Ti.UI.createView({
    top : 0,
    width : Ti.UI.FILL,
    height : 50, // Your custom navbar height
    backgroundGradient : { // Nice linear gradient, put your own custom colors here
        type : 'linear',
        startPoint : {
            x : 0,
            y : 0
        },
        endPoint : {
            x : 0,
            y : '100%'
        },
        colors : [{
            color : '#75060a',
            offset : 0.0
        }, {
            color : '#cc0000',
            offset : 1.0
        }]
    }
});
// I usually add a bottom border view, just looks better IMO
navbar.add(Ti.UI.createView({
    width : Ti.UI.FILL,
    height : 1,
    bottom : 0,
    backgroundColor : '#000000'
}))
win.add(navBar);

您可能希望为此添加自定义按钮和标题以使其更具功能性,但这应该可以帮助您入门。这种方法的好处是您拥有最多的控制权,并且它完全跨平台(在 android 上运行得很好)。

于 2013-05-13T17:46:29.083 回答