Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-12775] Android: Implement default values for view properties

GitHub Issuen/a
TypeStory
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2013-02-23T02:52:34.000+0000
Affected Version/sRelease 3.1.0
Fix Version/sRelease 3.1.0, 2013 Sprint 04 API
ComponentsAndroid
Labelsn/a
ReporterHieu Pham
AssigneeHieu Pham
Created2013-02-17T09:42:56.000+0000
Updated2017-03-09T01:22:16.000+0000

Description

In Android, when a property is set to null, we need to define default behavior for each property.
var label = Ti.UI.createLabel({
  text: 'hi',
  //html: null,
  color: null,
  highlightedColor: null,
  font: null,
  textAlign: null,
  verticalAlign: null,
  ellipzise: null,
  wordWrap: null,
  autoLink: null,
  layout: null,
  size: null,
  left: null,
  top: null,
  center: null,
  right: null,
  bottom: null,
  transform: null,
  backgroundColor: null
});
var image = Ti.UI.createImageView({
  width: null,
  height: null,
  images: null, 
  canScale: null,
  image: null,
  defaultImage: null
  
});
var win = Ti.UI.createWindow();
win.add(label);
win.open();
1.Run code, app shouldn't crash, you should see the text 'hi'

Comments

  1. Hieu Pham 2013-02-20

    PR: https://github.com/appcelerator/titanium_mobile/pull/3892
  2. Lee Morris 2017-03-09

    Closing ticket as fixed.

JSON Source