gpt4 book ai didi

ios - 使用后退按钮导航时,Titanium titleImage 从左侧跳转

转载 作者:行者123 更新时间:2023-12-01 18:14:31 26 4
gpt4 key购买 nike

我在使用 titleImage 的 Appcelerator Titanium 中遇到问题在 Windows 上。当一个新窗口打开时,titleImage 会像您期望的那样向左移动并淡出。但是当你使用后退按钮时,标题图像突然出现在左侧并动画回到中心,没有褪色。它看起来非常生涩和 splinter 。

这是我的代码,请参阅下面的问题截图:

查看

<TabGroup id="tabGroup">
<Tab id="tab1" title="Tab 1">
<Window id="win" title="Tab 1" titleImage="title-brand.png">
<Button onClick="openWindow">I am Window 1</Button>
</Window>
</Tab>
<Tab title="Tab 2">
<Window title="Tab 2">
<Label>I am Window 2</Label>
</Window>
</Tab>
</TabGroup>

Controller JS
function openWindow() {
var window2 = Ti.UI.createWindow({ title: "Window 2" });
var label = Ti.UI.createLabel({ text: "Hello!" });
window2.add(label);
$.tab1.open(window2, { animated: true });
}

$.tabGroup.open();

截图

正如您在此屏幕截图中看到的那样,当点击后退按钮时,窗口 1 会出现动画,但 titleImage 已出现在左侧,然后跳到中心:

enter image description here

最佳答案

尝试设置titleControl而是 titleImage .这是解决此问题的方法。

.xml

<TabGroup id="tabGroup">
<Tab id="tab1" title="Tab 1">
<Window id="win" title="Tab 1" titleImage="title-brand.png">
<Button onClick="openWindow">I am Window 1</Button>
</Window>
</Tab>
<Tab title="Tab 2">
<Window title="Tab 2">
<Label>I am Window 2</Label>
</Window>
</Tab>
</TabGroup>

.js
var imageView = Ti.UI.createImageView({
image : "KS_nav_views.png",
width : Ti.UI.SIZE,
height : Ti.UI.SIZE
});
$.win.titleControl = imageView;

function openWindow() {
var window2 = Ti.UI.createWindow({
title : "Window 2"
});
var label = Ti.UI.createLabel({
text : "Hello!"
});
window2.add(label);
$.tab1.open(window2, {
animated : true
});
}

$.tabGroup.open();

关于ios - 使用后退按钮导航时,Titanium titleImage 从左侧跳转,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23698240/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com