Community Questions & Answers
Prevent firing of change event when switch value is modified programmatically
Hi everyone, I have a simple (?) question, for those who can help. I am writing an iPhone home automation app, that talks through sockets to a simple TCP/IP server. I'm using Titanium SDK 1.6 and iOS SDK 4.1. In the app, at runtime, I create a bunch of...
Titanium.UI.Switch, disable ios animation on load (alloy data binding ugliness)?
I am using alloy and data binding a backbonejs collection to a table. In each row there is a switch. The switch has an event listener that changes the model. However, everytime you hit the switch, it re-renders the whole table. So, all of the switches on...
Switch BTN
<Switch id="basicSwitch" value="true" onChange="outputState"/> "#basicSwitch":{ top:"880", right:"20", titleOff:"", color:"red" } Hy Folks, Is it possiable to...
Switches always animating to on state (iOS)
In my app I have a table of switches that allow the user to opt in or out of various tags (which are dynamic and sync with our backend). Whenever the view is rendered, though, the switches all start at off and instantly animate to on. Is it possible to...
Switches inside tablevierows disappear when scrolling in tableview.
I have a problem that the switches disappear when scrolling, fast, in my tableview. I've tried to change row heights but doesnt help. Anyone knows about this problem?
Customize Switch
Hi Everyone, Is it possible to change the image that is used in a switch for IOS. I see there is a background image property but when I apply my image nothing changes. I am using the latest version of the TI Studio and SDK. Thanks in advance Sean
Change 'switch 2' from DISABLED to ENABLED when 'switch 1' is ENABLED.
~~~ pushSwitch.addEventListener('change', function(e){ switch(e.index){ case 0: soundPushSwitch.enabled = false; break; case 1: soundPushSwitch.enabled = true; break; ...
Switch changes state when rendered (to late)
My iOS example: I placed a Ti.UI.Switch in every table row of a table. If the state is set to "ON", the switch changes it state to "ON" with an animation as soon it gets rendered (scrolls into the visible screen) and unfortunately not...
Place the switch title in the right side of the selector control in android
Is there any option to place the switch title on the right side of the control(toggle button)? Also is there any way to change the color of the switch? I have tried changing the backgroundColor, backgroundGradient , backgroundSelectedColor and...
set tab to not active when other tab is active
I am creating a custom tabBar for Android that looks like the iOS tabBar. Now I have the tabBar at the bottom and each tab is has a dynamic width so that you can have virtually as many as you want as well I have the active states for each button working....
Toggle Switch
I need to create a Toggle Switch that will interact with other elements like changing the left property of an element. I looked at this and its examples( http://docs.appcelerator.com/titanium/latest/#!/api/Titanium.UI.Switch ) but Im not sure if it would...
Black Switch
Hi, This is drive me crazy. How can I create standard switch with black color - not default blue. Is it possible, at all. I tried almost everything. Please, help me. Kind regards, TM
Keep Ti.Ui.Switch from changing values
Hello I am trying to create an app where a user can use the switch method to keep certain settings. However, once the user exits the view the switch resets to its original value. I need help to keep this from happening an saving the current value as the...
how this UI element is called in Titanium?
I'm kind-a confused in here.. This switch is in Android preferences, I mean this should by default for everything that's called SWITCH. Titanium switch which I tried is just a toggle-button instead of actual switch as in the picture.. please tell me it's...
Cannot resize switch
I am a bit puzzled that the switch will not resize. Is it not resizable? Testing in IPhone simulator. Interested in height only. ~~~ var my_swch = Titanium.UI.createSwitch({ value:false, top:15, right:10, height:55, ...
how to change title size in switch control?
I finally found how to resize a switch control with heigh and width, but font size of titleOn and titleOff is not changing. it's really too small 150x150 switch control.
how to set size for Titanium.UI.Switch?
In this docs I can see property "Size" https://developer.appcelerator.com/apidoc/mobile/1.0/Titanium.UI.Switch When I try to set it like this ~~~ 1 var win = Ti.UI.currentWindow; 2 3 win.title = L('windowTracking'); 4 5 var SwitchTracking =...
customize switch
Hi, is it possible to have a switch like this : http://dzmob.net/switch.png thanks.
Ti.UI.Switch switching to "off" upon resume
I'm developing an iPad app using the latest Mobile SDK version 2.1.3.GA, and when building to iPad on the simulator and on the actual device (I haven't tried on iPhone or Android), my Ti.UI.Switch elements always switch back to the "off"...
Switch TitleOn and TitleOFF
I have created a switch and wen i turn on it shows a green bar else nothing....this working fine on my emulator but not working in the device ....
Checkbox UI control on iPhone?
I have an app with a series of table rows where I was using switches to determine whether an item in the row was chosen. Is there a checkbox control that can perform a similar purpose?
swith title on, title off on iphone
Hi, i want to set a value when switch is on and another value when switch is false (like oui and non in french or I/O) on iphone...i used titleon and titleoff but it doesnt work... can anyone help me please.. thank you..
Create android switch button
Can I create android 4.0 switch button (not checkbox or toggle button) with Titanium? example of on/off switch ![switch] (http://developer.android.com/design/media/settings_master_on_off_2.png) #### thanks,
Switch "ON" then fire event across whole app
I am looking at adding a switch to a page in an app and adding a fire event to it. When the switch is "ON" I would like it to increase the text size on each page of the app by 2-4 point. Any help on this would be great.
Switch widget iOS not always displaying
Hi all, I have a TableView consisting of custom TableViewRow objects which include a View housing a Label and a Swtich object. When the view is displayed, the Swtch objects are sometimes displayed, sometimes not displayed. Sometimes the Switch objects...
e.source what type of ?
Hey, i have a tableviewrow and on it there is a Button. Now i wanna do 2 different functions, if the user presses the row or the button instead. ~~~ eventTableView.addEventListener('click', function(e) { /*Ti.App.fireEvent('app:event.select',...
Switch triggers change on window opening and animates if value=true
This happens when running the app on iPhone simulator and on the actual device too. Switches are part of a TableViewRow. What happens exactly is that a change is triggered on the switch as soon as the window is loaded on screen. It doesn't matter if the...
Device Token for push
Hi, my application need to enable and disable (switch) the push notification. So my idea is to store device token to external MYSQL to push (I've got my own server setting up for push) and insert or delete to MYSQL. I have two problems: 1 - How to get...
How to switch Tab with animation?
Hi, Im new to Titanium and have a question. How to switch Tab with animation? My situation is; 1. TabGroup is hidden. 2. got a button to change tab by adding event. the eventListener of the button is like this; ~~~ theButton.addEventListener(click,...
Creating general iPad setting for an app
Hi, I have to create 2 switches which should be displayed in general iPad settings for an app. It should include functionalities for the 2 switches which will reflect in the app. Thanks in advance.. Any help is appreciated
Switch BackgroundColor
Hey there, Can someone please hack the native code of the UISwitch and implement the property `onTintColor` ? It can be used since iOS 4.0 to change the blue backgroundColor of switches to custom ones but i can't find that property in Ti-Mobile,...
Switch changing while loading
I created an Iphone switch and set the value to true. ~~~ var switch1 = Titanium.UI.createSwitch({ value:true, top:70, right:50 }); ~~~ My problem is when the window opens the switch quickly goes from off to on instead of loading in the on state. I...
Switch values
Is there anyway to change the values of a switch from "on / off" to yes / no? Iphone, SDK 1.8.2
Weird Switch Problem
I am using the following code to set switches for FB and Twitter (birdhouse) upon opening the app (apps.js): ~~~ Ti.App.addEventListener('shareauth', function(e){ if (bh.authorized()==false){ twitterSwitch.value = false; } else...
Android TabGroup hiccup when opening new window under a tab.
On android, I've noticed that whenever you open a new window under a tab, i.e. ~~~ var newWin = Ti.UI.createWindow({url:someUrl, fullscreen:false}); Ti.UI.currentTab.open(newWin, {animated:true}); ~~~ The screen animated to a blank screen for a split...
switch between tabGroup and window causes a crash~~
~~~ var win = Ti.UI.createWindow({ backgroundColor:'yellow', fullscreen:false, }); var tabGroup = Ti.UI.createTabGroup(); var win1 = Ti.UI.createWindow({ backgroundColor:'blue', fullscreen:false, }) var tab1 =...
possible bug in firing of events in Switch control
I put a switch inside a toolbar, I can click and change the value, but the only event that is fired is the "change" event. Events like "click", "longclick", "touchstart", etc, are never fired. Is this a known...
How to disable analytics with UI.switch
Hey friends, I have a quick question regarding enabling and disabling the analytics code within my app. I presently am using the Google Analytics module for tracking analytics. I would like to give the user an option to disable the sending of analytics...
Switch between views in a window
Hello, I currently have a set of tabs in my app each referring to some .js file. I would like to change one of these tabs to have a toolbar at the top with two buttons Option A and Option B. When the user clicks Option A then option_a.js should be...
Get an array of table row titles/indexes where a switch is true?
I have a grouped table with a switch in each row, like this:  What I want to do is click the button and get an array of the titles of all table rows...
Array of UI elements?
Hello, Is it possible to create a dynamically generated array of UI elements? For example, I'd like to download a list of string and attach a Titanium.UI.Switch to each string. I tried something like that but it didn't work: ~~~ var switchArray =...
linking two switches ~ switch value depends on another switch
I have two settings that can't be enabled both, so what I need is to switch the second switch off, when the first switch is switched on. And in reverse of course. Problem is that when I switch the other one within its change event, the change event is...
[Android] Problems with tableViewSection and switch
I've created a tableViewSection and a few tableViewRow's. Within the tableViewRows I have tried to add a label and a switch. When I add a switch to the row within a section the app force closes. Does anyone know why this is?
Need help in checkbox to the array
Hi, I am working with Titanium Mobile SDK 1.7.2 , android 2.3.3 environment. I am developing a simple checklist application, where i have the categories list through which the user can select the category with checkbox, some of these category checkboxes...
Switchbox with checkbox image issue!
Hi, I get the code below from this forum, but this code is not working for me. My Environment: Titanium Mobile SDK 1.7.1, Android SDK My code: ~~~ var paidSwitch = Titanium.UI.createSwitch({ top:240, left:50, value:false, ...
Need help on createSwitch selected value from multiple rows
Hi, My Environment: Titanium mobile 1.7.2, android sdk My code: ~~~ var db = Ti.Database.install('../databases/ChecklistDB.sqlite','ChecklistDB'); var productCategory = Ti.UI.currentWindow.productCategory; var rows = db.execute('SELECT * FROM revcheck...
Label before/beside switch button
Hi, How can i add a label tekst on the left side of a switch. Like: Recieve email: {switch} i'm online: {switch}
Create multiple variable in a loop
Hi, i want to how can i do to create multiple variable with a loop. Like this: ~~~ for (var j = 0; j < selectedData.length; j = j + 1) { var basicSwitch = Titanium.UI.createSwitch({ right:0, style:Titanium.UI.Android.SWITCH_STYLE_CHECKBOX, ...
Switch in Popover doesn't work
I created an ordinary switch and added it to a popover-window but it isn't shown. I tested it on the iPad simulator
navigating among windows
i am trying to switch from one window to another and back to the previous one ... but while doing so when i switch back to the first window .. the elements (buttons, views) are disabled and logcat shows that i am clicking on the window... here are my...
Showing 1-50 of 74 1 2