钛金属多线窗口标题

时间:2016-11-21 15:25:18

标签: titanium titanium-mobile

我狂热地试图使窗口多行的标题。 我有一个相当长的头衔,需要能够看到整个冠军。

现在,如果标题比窗口允许的话更长,标题就会被剪掉并有三个点 但是如果它太长,我需要它分成两行

我目前的标记如下:

<svg version="1.1" id="rocket_x5F_svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px"
    	 y="0px" viewBox="0 0 612 792" style="enable-background:new 0 0 612 792;" xml:space="preserve">
    <style type="text/css">
    	.st0{fill:#E6E7E8;}
    	.st1{fill:#F9AA30;}
    </style>
    <g id="rocket">
    	<path id="segment_x5F_1" class="st0 segment_1" d="M305.7,12.3c-14.8,21.5-24.6,47.6-34.8,71.1c10.3,23.8,20.3,43.2,35.3,65
    		c14.9-21.7,24.4-41.1,34.6-64.5C330.5,60.1,320.8,34,305.7,12.3"/>
    </g>
    <g id="matter">
    	<path class="st1" d="M278.4,76.7h-139c-5.4,0-9.9-4.4-9.9-9.9V47.4c0-5.4,4.4-9.9,9.9-9.9h139c5.4,0,9.9,4.4,9.9,9.9v19.4
    		C288.2,72.2,283.8,76.7,278.4,76.7z"/>
    </g>
</svg>

或者我可以使用多行标签吗?

有人有想法吗?

感谢名单

我的工作代码而不是塞巴斯蒂安

/////// create first starting window ////////
var startWin = Titanium.UI.createWindow({
    title: 'Some really long title that has to be wrapped',
    navBarHidden: false,
    exitOnClose: true,
    barImage: '/images/header_background.png',
    titleAttributes: {
        color: '#FFF',
        font: {
            fontSize: 20,
            minFontSize: 15,
            fontWeight: 'bold',
            wordWrap: true
        }
    }
});

2 个答案:

答案 0 :(得分:0)

我从来没有设法做到这一点,所以我总是隐藏标题栏并创建我自己的标题栏,你需要创建一个自定义主题来隐藏标题栏,iOS上也没有标题栏。 / p>

我主要使用合金并创建了一个导航控件视图,我通过引用添加到每个页面,然后在其中设置标题和菜单选项。

答案 1 :(得分:0)

您可以使用标签

设置window.titleControl
var startWin = Titanium.UI.createWindow({
  titleControl: Ti.UI.createLabel({
    text:'Some really long title that has to be wrapped'
    font:{
        fontSize: 20,
        minFontSize: 15,
        fontWeight: 'bold'
    }
  }),
  navBarHidden: false,
  exitOnClose: true,
  barImage: '/images/header_background.png',
});
相关问题