This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function doClick(e) { | |
if(OS_MOBILEWEB){ | |
var btn=document.createElement("BUTTON"); | |
btn.style.position='absolute'; | |
var t=document.createTextNode("CLICK ME"); | |
btn.appendChild(t); | |
document.body.appendChild(btn); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var text = "Have you tried <u>hyperloop</u> yet?"; | |
if(OS_IOS){ | |
var iOSText = text.replace(/<u>|<\/u>/g,""); | |
var attr = Ti.UI.iOS.createAttributedString({ | |
text: iOSText, | |
attributes: [ | |
{ | |
type: Ti.UI.iOS.ATTRIBUTE_UNDERLINES_STYLE, | |
value: Titanium.UI.iOS.ATTRIBUTE_UNDERLINE_STYLE_SINGLE, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<manifest> | |
<!-- Allows the API to download data from Google Map servers --> | |
<uses-permission android:name="android.permission.INTERNET"/> | |
<!-- Allows the API to cache data --> | |
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> | |
<!-- Use GPS for device location --> | |
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/> | |
<!-- Use Wi-Fi or mobile connection for device location --> | |
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/> | |
<!-- Allows the API to access Google web-based services --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var win = Ti.UI.createWindow({backgroundColor: 'white'}); | |
var search = Titanium.UI.createSearchBar({ | |
barColor:'#000', | |
showCancel:true, | |
height:43, | |
top:0, | |
}); | |
search.addEventListener('cancel', function(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var win = Ti.UI.createWindow({backgroundColor: 'white'}); | |
var search = Titanium.UI.createSearchBar({ | |
barColor:'#000', | |
showCancel:true, | |
height:43, | |
top:0, | |
}); | |
search.addEventListener('cancel', function(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var args = arguments[0] || {}; | |
var changeFontSize = null; | |
$.sectionTitle.text = args.title; | |
function setTitles(callback){ | |
if(args.criteria) { | |
var cLength = args.criteria.length; | |
for(var i=0; i<cLength; i++){ | |
var title = Ti.UI.createLabel({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var win = Ti.UI.currentWindow; | |
var alertDialog = Titanium.UI.createAlertDialog({ | |
title: 'System Message', | |
buttonNames: ['OK'] | |
}); | |
var data = [ | |
{title:"Refresh",color:'#000',height:50}, | |
{title:"Row 1",color:'#000',height:50}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var container = Ti.UI.createView({ | |
height : Ti.UI.SIZE | |
}); | |
var dashboardTileHolder = Ti.UI.createView({ | |
top : 0, | |
layout : "vertical", | |
height : Ti.UI.SIZE | |
}); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var win = Ti.UI.createWindow(); | |
var leftTileView = Ti.UI.createView({ | |
backgroundColor:"red", | |
height:(Math.random()*200), | |
width:"59%", | |
left:0 | |
}); | |
var tileContainer = Ti.UI.createView({ |
NewerOlder