Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8550025
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T13:51:24+00:00 2026-06-11T13:51:24+00:00

I am developing an app in titanium, and completed the iOS version successfully. Android

  • 0

I am developing an app in titanium, and completed the iOS version successfully. Android is presenting some problems, here is one.

The view contains a number of labels to display data in the format
A:B (note that B is bold). That bold part is necessary, and the reason I need two labels.

This is the code I am using:

if(restaurant && !(restaurant=='no' && restaurant.length=='2')){
    var restaurant_label = Ti.UI.createLabel({
        text:'Restaurant:',
        left:3,
        height:20,
        width:'auto',
        top:0,
        textAlign:'left',
        color:'#000',
        font:{
            fontFamily:'Helvetica Neue',
            fontSize:13,
            fontWeight:'Regular'
        }
    });
    view.add(restaurant_label);
    var restaurant_value = Ti.UI.createLabel({
        text:restaurant,
        left:restaurant_label.width+10,
        height:'auto',
        width:'auto',
        top:-18,
        textAlign:'left',
        color:'#000',
        font:{
            fontFamily:'Helvetica Neue',
            fontSize:13,
            fontWeight:'Bold',
            fontStyle:'Italic'
        }
    });
    view.add(restaurant_value);
    check_localservices = false;
}

The “value” label needs to be in the right spot, but android does not seem to be able to get the width of the previously added label.

What gives?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T13:51:26+00:00Added an answer on June 11, 2026 at 1:51 pm

    It appears in a bug report that there was some question as to what it suppose to be reported by a label.width query. According to the bug report for version 1.7, a correct response to YOUR query should return ‘auto’ on Android. This is the case because you have ‘auto’ as the value for width. Does it return ‘auto’?

    https://jira.appcelerator.org/browse/TIMOB-3202

    It so happens that it looks like the correct code is listed there to get the value you are looking for. I haven’t tested this, but it appears you might be querying the wrong value.

    For your situation it appears you want to use:

    var restaurant_value = Ti.UI.createLabel({
            text:restaurant,
            left:restaurant_label.size.width+10, // <===== size
            height:'auto',
            width:'auto',
            top:-18,
            textAlign:'left',
            color:'#000',
            font:{
                fontFamily:'Helvetica Neue',
                fontSize:13,
                fontWeight:'Bold',
                fontStyle:'Italic'
            }
        });
    

    According to the comments, you might need to also query the size property after ‘opening’ the window. If you look at Paul Dowsett’s answer, he has an example of a listener on the ‘open’ event.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing my android app in Titanium. For certain views(e.g Ti.UI.View) I was
I am developing app for Android. And as some of members suggested to use
I have a Titanium Android app that I'm developing and recently deployed to the
I am developing an app using Titanium for both iPhone and Android. I want
We are developing an app using Appclerator titanium. We have a free version of
I am developing an App using Titanium for iPhone and Android. I created a
I'm starting developing app in WindowsPhone, and had some problems. I trying to add
Am looking into developing an iPhone native app using Titanium Developer Since this is
Im developing an app for iPhone, in wich one of the functionalities is an
im developing a app in Android. in this project im using a List of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.