标签: titanium-alloy

如何防止钛合金视图中的事件冒泡?

在文档中,您似乎可以通过将参数传递给文本字段上的click事件来阻止冒泡:

http://docs.appcelerator.com/titanium/3.0/#!/api/Titanium.UI.TextField-event-click

使用他们的新Alloy框架,我有一个像这样声明的文本字段:

<TextField id='name' onClick='doStuff' />
Run Code Online (Sandbox Code Playgroud)

在我的控制器中我有这个功能:

function doStuff(e) {
  alert('hello');
}
Run Code Online (Sandbox Code Playgroud)

但是,此元素包含在一个容器元素中,该元素也有一个onClick事件,我想在单击文本字段时阻止该元素触发.我怎么能做到这一点?

javascript titanium ios titanium-alloy

6
推荐指数
1
解决办法
4386
查看次数

嵌套视图会降低图像质量

当艺术部门的人员注意到图像质量下降时,我在最近的一个项目中遇到了这个问题.我不确定是什么导致它,但是我们能够通过删除它嵌套的ScrollView来解决问题.但这不是一个可行的解决方案,因为我们需要在嵌套在scrollviews中的视图中嵌套图像.

我的代码看起来像:

<View>
    <ScrollView>
         <View>
              <ImageView image="someImage.png" />
         </View>
    </ScrollView>
</View>
Run Code Online (Sandbox Code Playgroud)

当我们从嵌套的ScrollView和它的直接父视图中删除ImageView时它渲染得很好.我用一个简单的项目创建了一个repo来说明这一点.暗淡效果最明显的是字母的颜色,文本上的白色阴影和灰色边框的模糊.

https://bitbucket.org/bwellons/blurry-images

这是一个需要报告的错误,还是某个地方的文档说"不要这样做",我不知道?

关心布兰特

titanium ios titanium-alloy

5
推荐指数
1
解决办法
189
查看次数

Titanium facebook模块单线程

我使用Titanium(3.1.3)和Alloy实现了facebook登录.

但有时当我尝试登录时,我发送此消息错误.

message = "FBSession: should only be used from a single thread";

facebook titanium titanium-modules titanium-alloy

5
推荐指数
1
解决办法
452
查看次数

Titanium - Facebook模块不使用本机登录

我正在尝试将facebook登录到我正在尝试使用Titanium开发的应用程序,当我点击"连接"按钮时,它会显示一个如下所示的对话框: 登录

它看起来像一个web-app facebook登录,而不是本机应该是什么样子.我希望它是这样的: 另一次登录

那么,我怎样才能使这个模块使用本机登录对话框而不是这个web风格的对话框呢?

android titanium titanium-mobile facebook-login titanium-alloy

5
推荐指数
1
解决办法
3724
查看次数

钛合金SplitWindow IOS奇怪的行为改变宽度

  <SplitWindow id="home" platform="ios" formFactor="tablet">
            <Require src="master" id="master"/>
            <Require src="detail" id="detail"/>
  </SplitWindow>
Run Code Online (Sandbox Code Playgroud)

strange behavior如果我black separation line在两个窗口之间水平拖动,我有一个.窗户改变大小适应我​​的动作.

在此输入图像描述 在此输入图像描述 在此输入图像描述

而且,如果我更改width窗户更容易识别black separation line

function demo() {
Alloy.Globals.master.win.width = 512;
Alloy.Globals.detail.win.width = 512;
}
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述 在此输入图像描述

[For test purpose you have to aim the exact pixel of the black separation line ]

你能说出为什么会发生这种情况,我该如何阻止这种行为?

javascript titanium titanium-mobile ios7 titanium-alloy

5
推荐指数
1
解决办法
235
查看次数

Titanium SDK 3.2 [错误]:无效的"--ios-version"值"7.0"7.0.3

当我升级到钛SDK版本3.2时,我在iOS上运行时出现错误:钛无效"--ios-version"值"7.0"可接受的值:7.0.3,有什么办法可以解决这个问题吗?

titanium ios titanium-alloy

5
推荐指数
1
解决办法
5024
查看次数

Appcelerator钛 - 合金与经典

我即将开始一个新的Titanium项目.到目前为止,我所写的是现在被认为是"经典项目"(我在合金之前就开始编写Titanium应用程序)了.

我想知道在为我的新项目切换到Alloy时是否值得.我知道基本上,在编译到java项目或objective-c项目之前,Alloy编译为"Classic"Titanium代码.我也知道"预编译"过程中的一大优势,即在合金代码中标记仅与Android或iPhone相关且在编译的"经典"代码中不包括其他代码.

我主要担心的是灵活性 - 就像"经典"一样,我觉得我对代码有更多的控制权以及正在发生的事情.

第二个问题,我有控制(如开源滑动菜单),不是为合金编写的 - 我怎样才能将它们作为我项目的一部分?

我发现(在TiConf 2014中引入)TI UX(https://github.com/jaraen/Ti.UX.Templates)是为Alloy编写的,我开始要求自己使用Alloy.

其他几个问题:

  1. 如何在Alloy内部运行旧的UI代码?
  2. 我可以在"经典"项目中为Alloy运行编写控件吗?
  3. "Classic"项目是否也可以映射出不属于iOS/Android的代码?
  4. Alloy项目和Classic项目之间的性能有何不同?其他灵活性问题呢?

谢谢

titanium appcelerator appcelerator-mobile titanium-mobile titanium-alloy

5
推荐指数
1
解决办法
2494
查看次数

在Alloy Titanium中按类选择项目

在Alloy Titanium中,我可以使用他们的id访问XML元素,$.element_id但是如何通过他们的类获取元素?

我有

<View id="main" layout="horizontal" horizontalWrap="true">
    <Button left="4%" width="125dp" height="125dp" backgroundImage="menus/woodblock.png"></Button>
    <Button left="13%" width="125dp" height="125dp" backgroundImage="menus/woodblock.png"></Button>
    <Button class="top30" left="4%" width="125dp" height="125dp" backgroundImage="menus/woodblock.png"></Button>
    <Button class="top30" left="13%" width="125dp" height="125dp" backgroundImage="menus/woodblock.png"></Button>
    <Button class="top30" left="4%" width="125dp" height="125dp" backgroundImage="menus/woodblock.png"></Button>
    <Button class="top30" left="13%" width="125dp" height="125dp" backgroundImage="menus/woodblock.png"></Button>
</View>
Run Code Online (Sandbox Code Playgroud)

我希望得到所有 class="top30"

titanium titanium-alloy

4
推荐指数
1
解决办法
2910
查看次数

message ="'undefined'不是钛中的函数(评估'bookview.open()')"

我是TitaniumMobile的新手,我目前正在接受官方教程,但我还是在做这个阶段

function showBook(event) {
    var selectedBook = event.source;var args = {
        title: selectedBook.title,
        author: selectedBook.author
    };
    var bookview = Alloy.createController("bookdetails", args).getView();
    bookview.open();
}      
Run Code Online (Sandbox Code Playgroud)

当我尝试使用ios模拟器运行时,我有点困在上面的阶段,并发生以下错误.

  Script Error {
[ERROR] :      backtrace = "#0 () at :0";
[ERROR] :      line = 27;
[ERROR] :      message = "'undefined' is not a function (evaluating 'bookview.open()')";
[ERROR] :      name = TypeError;
[ERROR] :      sourceId = 344963552;
[ERROR] :      sourceURL = "file:///Users/hivelocity/Library/Application%20Support/iPhone%20Simulator/7.1/Applications/6B8062FB-B379-407A-8553-184EED274850/FaveBooks.app/alloy/controllers/index.js";
[ERROR] :  }
Run Code Online (Sandbox Code Playgroud)

titanium titanium-mobile titanium-alloy

4
推荐指数
1
解决办法
1918
查看次数

无法隐藏标题栏钛合金

我在使用Alloy MVC的Titanium Appcelerator中遇到了问题.此问题包含以下内容(请参见图片)

在此输入图像描述

我无法删除找到应用名称和徽标的黑条.我在设备上运行应用程序(谷歌Nexus,没有模拟器)

我已尝试以下方法删除此内容:

XML:

<Alloy>
    <Window>
    </Window>
</Alloy>
Run Code Online (Sandbox Code Playgroud)

TSS:

"Window":
{
    navBarHidden:true,
    fullscreen:true,
    backgroundColor:"Orange",
    orientationModes:[Ti.UI.PORTRAIT],
}
Run Code Online (Sandbox Code Playgroud)

TiApp.XML:

<statusbar-style>default</statusbar-style>
<statusbar-hidden>true</statusbar-hidden>
<fullscreen>true</fullscreen>
<navbar-hidden>true</navbar-hidden>
Run Code Online (Sandbox Code Playgroud)

但是这些选项中没有一个能够隐藏这个黑条.在iOS模拟器中,它仅通过将属性设置fullscreen为true来删除导航栏

还有其他选择可以解决这个问题吗?提前致谢!

android titanium appcelerator titanium-alloy

3
推荐指数
1
解决办法
6326
查看次数