Ti.UI.Window 上的 barImage 使用的分辨率/图像尺寸是多少?
What's the resolution / image sizes to use for barImage on Ti.UI.Window?
基本上,我想做一些类似 Instagram 的事情
(http://avocadosocial.com/wp-content/uploads/2016/08/IMG_3921.jpg) 与起始 window 的 barImage
有关。我想放在那里的徽标也或多或少在这个尺寸上(大约 16:9)。我找不到正确的 resolutions/dimension 信息(理想的 height
和 width
)用于 barImage
属性。
有人可以帮忙吗?
首先,我认为您提供的 link 中没有使用 barImage,但您仍然可以通过以下步骤获得完美的结果:
对于Window标题,您可以这样自定义:
"Window[platform=ios]": {
backgroundColor : 'white',
navTintColor : 'white',
barColor : Alloy.CFG.COLOR_PRIMARY,
titleAttributes : {
color : 'white',
font : { fontFamily : 'font', fontSize : 18 }, // see how to use custom fonts in Appc Docs
},
swipeToClose : false
}
titleAttributes 应用于导航堆栈中 window 的标题。
对于 left/right 导航按钮,我更喜欢使用这种类型的代码:
不要在按钮中使用 ImageView,使用 Button 并使用 fontAwesome 或 Material Icons 字体文件设置标题。
<RightNavButton>
<View>
<Button class="materialFont" title="\ue5cd" onClick="close" />
</View>
</RightNavButton>
记得在视图中使用按钮,否则你的字体将不会应用到按钮,你会看到一些奇怪的图像。
基本上,我想做一些类似 Instagram 的事情
(http://avocadosocial.com/wp-content/uploads/2016/08/IMG_3921.jpg) 与起始 window 的 barImage
有关。我想放在那里的徽标也或多或少在这个尺寸上(大约 16:9)。我找不到正确的 resolutions/dimension 信息(理想的 height
和 width
)用于 barImage
属性。
有人可以帮忙吗?
首先,我认为您提供的 link 中没有使用 barImage,但您仍然可以通过以下步骤获得完美的结果:
对于Window标题,您可以这样自定义:
"Window[platform=ios]": {
backgroundColor : 'white',
navTintColor : 'white',
barColor : Alloy.CFG.COLOR_PRIMARY,
titleAttributes : {
color : 'white',
font : { fontFamily : 'font', fontSize : 18 }, // see how to use custom fonts in Appc Docs
},
swipeToClose : false
}
titleAttributes 应用于导航堆栈中 window 的标题。
对于 left/right 导航按钮,我更喜欢使用这种类型的代码:
不要在按钮中使用 ImageView,使用 Button 并使用 fontAwesome 或 Material Icons 字体文件设置标题。
<RightNavButton>
<View>
<Button class="materialFont" title="\ue5cd" onClick="close" />
</View>
</RightNavButton>
记得在视图中使用按钮,否则你的字体将不会应用到按钮,你会看到一些奇怪的图像。