Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-9333] Android: UI components do not respect positioning properties in "horizontal" layout

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionInvalid
Resolution Date2013-03-11T07:29:40.000+0000
Affected Version/sRelease 2.1.0, Release 2.0.1
Fix Version/sRelease 3.0.2
ComponentsAndroid
Labelscore, ipass1
ReporterIvan Skugor
Assigneejithinpv
Created2012-05-31T01:11:58.000+0000
Updated2017-03-17T18:47:35.000+0000

Description

Comments

  1. Junaid Younus 2012-05-31

    Tested on a Samsung Galaxy S2 running 2.3.6, issue reproducible on TiSDK 2.0.1GA2.
  2. Ivan Skugor 2012-05-31

    This bug is reported and tested for Android (I see that component part is set to iOS). Parity issue should be opened for iOS.
  3. Junaid Younus 2012-06-01

    My mistake, accidentally selected iOS instead of Android. I only tested this on an Android device. Updated the ticket to reflect the correct platform.
  4. Ivan Skugor 2012-06-01

    Thanks. :)
  5. Ken Liu 2012-09-17

    I'm having a similar problem with vertical layouts - a set of textfields within a view are not respecting the bottom property. However, when I switch to using the top property to manage spacing between elements it works. Code snippet here. Switching to top worked to create a gap between text fields, using bottom didn't // Set up base view and UI elements var settingsView = Titanium.UI.createView({ width : Ti.UI.FILL, height : Ti.UI.FILL, top : 0, left : 0, backgroundColor : "#fff", }); var acctView = Titanium.UI.createView({ width : Ti.UI.FILL, height : Ti.UI.FILL, top : 10, left : 10, bottom : 10, right : 10, layout : "vertical", backgroundColor : "#ccc", borderRadius : 5, }); // Create userView elements var title = Ti.UI.createLabel({ width : Ti.UI.FILL, height : Ti.UI.SIZE, top : 8, left : 5, bottom : 8, text : "Signup" }); var titleSeperator = Ti.UI.createLabel({ width : Ti.UI.FILL, height : 2, backgroundColor : "#000", }); var userNameField = Titanium.UI.createTextField({ width : Ti.UI.FILL, height : Ti.UI.SIZE, left : 10, right : 10, top : 16, backgroundColor : "#FFF", borderWidth : 1, returnKeyType : Titanium.UI.RETURNKEY_DONE, hintText : "Enter your username", autocapitalization : Titanium.UI.TEXT_AUTOCAPITALIZATION_NONE, }); var userPassword = Titanium.UI.createTextField({ height : Ti.UI.SIZE, left : 10, right : 10, top : 16, backgroundColor : "#FFF", borderWidth : 1, returnKeyType : Titanium.UI.RETURNKEY_DONE, hintText : "Enter password", passwordMask : true, });
  6. jithinpv 2013-03-11

    it is not a bug, change the width property of each component, you will get the expected result. try this code: (function() { var win = Ti.UI.createWindow({ backgroundColor: "#fff", navBarHidden: true, layout: 'horizontal' }); var label1 = Ti.UI.createLabel({ top: 150, left: 50, text: 'Testing 1 ...', height: '75dp', width: '25dp', backgroundColor: "#000" }); var textField = Ti.UI.createTextField({ top: 150, left: 50, height: '75dp', width: '25dp', }); var label2 = Ti.UI.createLabel({ top: 150, left: 50, text: 'Testing 2 ...', height: '75dp', width: '25dp', backgroundColor: "#000" }); var picker = Ti.UI.createPicker({ top: 150, left: 50, height: '75dp', width: '25dp', backgroundColor: "#999", selectionIndicator : true }); var data = []; data[0] = Ti.UI.createPickerRow({ title:'Bananas' }); data[1] = Ti.UI.createPickerRow({ title:'Strawberries' }); data[2] = Ti.UI.createPickerRow({ title:'Mangos' }); data[3] = Ti.UI.createPickerRow({ title:'Grapes' }); picker.add(data); win.add(label1); win.add(textField); win.add(label2); win.add(picker); win.open(); })(); Tested with Titanium Studio, build: 3.0.1.201212181159 Titanium SDK version: 3.1.0 (03/11/13 15:43 0c88429) Titanium SDK version: 3.0.2 (02/07/13 16:46 a4def81) Device: Samsung galaxy s duos Android version: 4.0.4 Android Emulator: Android SDK version: 2.2
  7. Lee Morris 2017-03-17

    Closing ticket as invalid.

JSON Source