Skip to content

Instantly share code, notes, and snippets.

@exclusiveTanim
exclusiveTanim / app.js
Last active August 29, 2015 13:58
Code for Geolocation and Mapping
/*Its a simple code for Map*/
var MapModule = require('ti.map');
var win = Ti.UI.createWindow({backgroundColor: 'white'});
var scrollView = Ti.UI.createScrollView({
top : 20,
layout : 'vertical',
contentWidth : 'auto',
contentHeight : 'auto',
showVerticalScrollIndicator : true,
@exclusiveTanim
exclusiveTanim / app.js
Created April 5, 2014 15:49
MY CALCULATOR
/*ALl Logical and graphical codes for Calculator*/
var self = Ti.UI.createWindow({
title : "GENERAL CALCULATOR",
backgroundColor : '#000',
layout : 'vertical',
orientationModes : [Ti.UI.PORTRAIT]
});
// Create a TextField.
@exclusiveTanim
exclusiveTanim / app.js
Last active November 13, 2016 21:50
Marquee type animation
/*
Hello, I have tested this issue in Ti SDK 3.3.0.RC. Its working good.
Testing Environment:
Titanium SDK: 3.3.0.RC, 3.2.3.GA
Titanium CLI: 3.2.3
IOS Simulator 7.1
Appcelerator Studio, build: 3.3.0.201406271159
*/
@exclusiveTanim
exclusiveTanim / ViewInDelails.js
Created April 29, 2014 02:06
Site manager project
function viewindetails(ids) {
var win = Ti.UI.createWindow({
layout : 'vertical',
title : 'View Data In Details',
backgroundColor : "#663399"
});
//alert(ids);
var viewinfo = Ti.UI.createLabel({
text : 'Information View in Details:',
@exclusiveTanim
exclusiveTanim / app.js
Last active August 29, 2015 14:01
Shading effect on button
/*shading effect on button without using an image. By using following code we can create button in different colours.
if we want to add Shading effect on a button without using an image, we use the backgroundGradient property on the button.
Here we can see the following example where a button with 3 gradient colours: red, blue and green.*/
var testWin = Titanium.UI.createWindow({
backgroundColor : '#ccc',
layout:'vertical'
});
var imageView = Titanium.UI.createImageView({
image : 'images1.jpeg',
@exclusiveTanim
exclusiveTanim / app.js
Created May 25, 2014 05:32
iOS:Gap between views from ScrollableView
/*Make the scrollableView wider than the device width, make the child views the same width as the device and
then the offset the scrollableView with a minus margin equal to half the difference of the two widths.
So if we set scrollableView width to 340 and the child views to 320,
then the left margin will be -10. Here is a example below.*/
var win = Ti.UI.createWindow({
backgroundColor : '#ccc',
title : 'Test'
});
var tab = Ti.UI.createTab({
icon : 'KS_nav_views.png',
@exclusiveTanim
exclusiveTanim / app.js
Created May 25, 2014 05:35
Circle View Creation
/*By the following code we can create circle view*/
var win = Ti.UI.createWindow();
var shapeSize = 300;
var shapeRadius = shapeSize *0.5;
var shapeResizeH = shapeSize *0.7;
var shapeResizeW = shapeSize* 0.7;
var view = Ti.UI.createView({
width:shapeSize,
@exclusiveTanim
exclusiveTanim / app.js
Created May 25, 2014 05:39
iOS: How to animate window left/right
/*To animate window from left to right or right to left in iOS, we can use a similar approach as the following code.*/
pWidth = Titanium.Platform.displayCaps.platformWidth;
pHeight = Titanium.Platform.displayCaps.platformHeight;
var animOutLeft = Ti.UI.createAnimation({
duration : 500,
left : -pWidth
});
var animOutRight = Ti.UI.createAnimation({
duration : 500,
@exclusiveTanim
exclusiveTanim / app.js
Last active August 29, 2015 14:01
Adding search Bar on TableView
/*
Hello, I have tested this issue in Ti SDK 3.3.0.RC. Its working good.
Testing Environment:
Titanium SDK: 3.3.0.RC, 3.2.3.GA
Titanium CLI: 3.2.3
IOS Simulator 7.1
Appcelerator Studio, build: 3.3.0.201406271159
@exclusiveTanim
exclusiveTanim / app.js
Created May 26, 2014 06:45
Change the displayed window title
/*If we want to change the displayed window title when a webView is loaded, we can use the following sample code. */
var win1 = Titanium.UI.createWindow({
title : 'Window 1',
backgroundColor : '#fff'
});
var webView = Ti.UI.createWebView({
url : "http://www.google.com"
});