Community Questions & Answers
Height problem - tableView inside a scrollview
Hello people. I've been trying without much success to place a tableView inside a scrollView. The problem is that, even if the height of the tableView and scrollView is set to auto, on Android the tableView doesn't fully fill the Scrollview height. iOS...
progressBar Height on android
Is there any way to remove the space for the message on an android progressBar? Because I need to set a height for it, that should be good as 8dp, BUT under this way the progressBar won`t show up, beacause on android, the progressBar view always come with...
Animate view height
Hi all. Is it possible to animate a view from height 0 to height Ti.UI.SIZE?? ~~~ someView.animate({ height:Ti.UI.SIZE, duration:1000 }); ~~~ When i try this, the window just is shown with any animation.
Element height isn't being re-calculated when adding children
I'm running into an issue on iOS where the height of an element isn't recalculated when adding children to it. I got an issue on some window where I tried to make a footer. This works fine on android devices, however a ran into an issue on iOS devices....
Get dimensions (width and height) of video file on Android
Has anyone succesfully retrieved width + height from a video on Android? If yes, how? I've spent the past five hours Googling and searching Q&A for an answer, but no luck. Things I've tried. * Loading video into Ti.MediaVideoPlayer - does not report...
ListView with auto height row
Hi, I can't figure out how to set the row height of new ListView to 'auto'. Due to dynamic content, I can not set a fix height. I have tried it with 'auto', Ti.UI.SIZE and Ti.UI.FILL as item property but nothing works. Even if I wrap an auto-sized view...
How to calculate height of tabGroup
I'm trying to make a view the height of the device which is done easily using Ti.Platform.displayCaps.platformHeight but then I want to subtract the tabGroup height from it to make it appear exactly under the tabGroup. I know it can be done with...
scrollView height 100% - 50px
Hi, i make a header with a height of 50px, and under this header i have to put a scrollView with the rest of the window height. How can i calculate this height? because i use Ti.Platform.displayCaps.platformHeight but this height includes the android...
Picker height (number of visible rows)
Hi there, I'm trying to make a picker have less height, but if I'm transforming it with ~~~ Ti.UI.create2DMatrix().scale(1,0.4); ~~~ it will look very ugly because it's not he same scale So I need a picker to have 100% width (320px) and only like 60px...
Can't create a label of 1px height
I'm trying to emulate a border of 1px between some views and I'm using a label for that of 1px height with no contents and just a background color. The label however looks much thicker, at least 2 pixels thick instead of just 1 pixel,as you can see on the...
Get TableView contentSize on the fly
How can I get TableView total height when adding data/rows? I notice that I can only get the height by wrapping the TableView with a normal view and get its view.size.height, but that it's after the loop is finished. ~~~ var wrapping =...
how to get label size?
I need to get the size of a label, so that I can position it in relation to another label. The following code does not work: ~~~ label = Ti.UI.createLabel({ title: token + " ", font: {fontSize: 20}, width:'auto', height:...
How does titanium calculate the height of a Picker {useSpinner: true} on Android?
Hi My goal is it do design an Android UI that looks similar on different devices (screen resolutions). Since it is not possible to set the dimensions of a Picker used as Spinner, my plan is to design around the picker. Therefor I need to be able to...
Label does not exhibit correct multiline behavior inside of tableview (2.0)
Appcelerator 2.0 for iOS 5.1 I noticed this behavior in an app I began developing with 1.8 when I upgraded to 2.0. I have a tableview that contains rows which each contain a label. The labels are of varying sizes and may span multiple lines. Sometimes, a...
Dynamic height of a WebView or a StyledLabel
Hey Appcelerator Developer, I'm just testing with an AdServer System and new kinds of Ads. The problem is, that the Ad will change its height when you click on it via JavaScript. How can I achieve that the WebView will change its height accordingly?...
imageView 100% width / auto width bug
For some reason, it looks like setting an imageView (with remote image) to 100% height and auto width is not working. I want the image to fill the height of the parent container. This container has deviceHeight, 100% of the screen. But I need the image to...
ListView's item height
Hi. How can I define ListView's item height? But I don't mean to define height of particular item: ~~~ { type: 'Ti.UI.Label', bindId: 'title', properties: { height: 50 } } ~~~ but to define height of that row (like to define table view row's...
Webview: Auto height doesn't work
Hello I have a webview in my app with above that webview a label and an imageview. I made a mainView to hold the label, imageview and webview. Now when I put the webviews height on auto, i can't scroll (well i can scroll a little piece down, but it goes...
Is it possible to get the height of a tableview dynamically?
I have a tableview that I continuously add rows to depending on user input. Is it possible to get the height of the tableview somehow?
Real height of Ti.UI.SIZE not correct
Hi guys, I have a table view which have a customized tableview row. Inside the row, I have a label that height is set to Ti.UI.SIZE. Then i need to add another label below the first label. The problem now is that I can't successfully get the height of...
imageView 100% height combined with auto width not working
For some reason, it looks like setting an imageView (with remote image) to 100% height and auto width is not working. I want the image to fill the height of the parent container. This container has deviceHeight, 100% of the screen. But I need the image...
Detecting an iPhone 5 versus previous iPhone versions
Hi there- I am looking to create an iPhone app utilizing a ScrollableView control. With this control, I am looking to place a fixed margin at the top and bottom as well as the sides of the control. I would like this margin to appear consistent on all...
Label overflowing bottom of grouped tableview row
 Why is this happening? This tableview section is created in a loop and the label that is causing...
Short iPad/ iPhone image size guide
I only recently discovered you could add "@2x" to the end of image filenames to improve display on the iPhone 4, so I thought I'd share a short image guide for anyone who needs it. This may be old news to some of you, but just in case. Add extra...
Can I scale an ImageView, ignoring it's original aspect ratio?
I have an ImageView I've added to a Button that loads an image from a server. When I set the height and width properties the image scales, but it maintains it's original aspect ratio. I'd like to stretch the image instead. Is this possible? Thanks!
Android Dev : images for different resolutions (ldpi, mdpi, hdpi)
Hi, i'm new to Titianium, i need to know how images work for android devices by using titanium. For example, i have uploaded different resolution images according to folder in Resources\android\images\res-long-port-hdpi and so on.. I have created a text...
Height of status Bar?
I would like to get the height of the status bar, however i cannot find out how to do it in code. I found the following answers, however i am not sure if that covers every possible...
TiImageView height/width wrong with 3.0.x and using images array
When creating an animated imageView with an images array, it is not respecting view's height and width. It happens with sdk 3.0.0 and 3.0.2 but it works fine with 2.1.4. As a workaround I've replace TiUIImageView.h and TiUIImageView.m with sdk 2.1.4...
Titanium (Android) fails to get width and height of an image
Hi, with this code, I'm trying to get the width and height of an image: ~~~ var assets = ["back","buy","stop","get"]; var assetsLen = assets.length; var commonPath = "/images/assets/"; for(var...
Get TableView's height
I have a complex window with several views in it. I want to scroll the full page with all the views at once. I have a ScrollView attached to the Window, and a View with auto height in it. In this View are the other two Views and a TableView. I have exact...
Alloy - Navbar height is wrong
Hi, i am working on a iOS app using Alloy 0.3.6 and SDK 3.0.0. While design the app i realized that the navbar is not 44dp as it should, but 43dp. To verify this i created a new alloy project with the following...
Retrieving height of labels after setting text value
Hi all, there's a similar post about but doesn't seems to work... what I need is found a way to retrieve the height of a label with a height set to 'auto' after setting its text value. this is my code: http://pastie.org/private/fev45vx6nv2dprd7ruwprw If...
iPhone 5 Titanium.Platform.displayCaps.platformHeight
I was expecting 1136. Instead, I got 568?
Android bug: TabGroup doesn't resize
Hi, Just to report a bug on Android (iPhone is OK). Ti 1.2.1 Ti SDK: 1.3 ~~~ var tabGroup = Titanium.UI.createTabGroup(); tabGroup.height=410; tabGroup.bottom=0; tabGroup.open(); ~~~ On iPhone, the tabGroup is well resized. On Android, the tabGroup...
View height without navGroup / tabGroup / statusBar
Hi, what is the best solution for obtain accurate view height ? In some windows I have navGroup + tabGroup somewhere only statusBar and I need accurate view height size because view is moving ( From down to top: 0 and then back down [hide] ). Problem is...
iOS fix to calculate the label height
This is a quick fix for those of you who (like me) are tired of various complicated workarounds for label height calculation. Note that this fix is for iOS. - Navigate to iOS titanium SDK, mine is in `/Library/Application...
Calculating proportional width and height of images.
Suppose I need a image size maximum of 70*70 so that it can get fit into container , but I download images in my app are of different width and height , but I want to resize image proportionately. I am also able to find the actual width and height of...
Android: visible screen size (sans tabgroup)
While developing on Titanium for Android, I need to set the dimensions of a mapview to put on a window, and specifically need to set the mapview's height. Therefore, I need to know what the visible screen size is. Here's the layout: - Tabgroup (whatever...
Best practice to position objects next to each other
Hi all, I have some view with auto height, and different content amount inside. What I wont is to position them in a scrollview next to each other. Actual I try to calculate next top position after postlayout event, it seems not to work :) so what is...
How to handel UI Components with dynamic sizes ?
Hi, how do you deal with UI components that increase/decrease dynamically in size? I've a scenario where I've to add some buttons under a label. The label is filled with dynamic data from JSON so its size isn't fix. Now how should I position the below...
Solution to all sizing problems (labels, etc.) for both Android and iPhone and some personal advices
This is not a question, it aims to be a solution. It's also the result of losing many hours looking for things that should be essential and easy to do and not being able to find them in this forum. In fact, you find tons of times the same very basic...
how can i get the height of window excluding the keyboard height
Application type: mobile Titanium SDK: 2.1.2 Platform & version: Android 4.0.3 when i focus on a textarea i want to get the height of the window visible area excluding the softkeyboard height. i tried just get the keyboard height but didnt find a...
Ti.UI.SIZE not working properly with width
Hey guys, the title is pretty self-explanatory, I have a web view with dynamic content, so I need to create a webview with 'auto' width and height, since that's deprecated, I decided to use Ti.UI.SIZE, for height, it works beautiful, however for width, it...
Dynamic view heights in ScrollView with SDK 2.0.1
Probably, this isn't an unknown issue but I wasn't able to find anything helpful in the Q&A's. I have an ScrollView with `contentHeight:'auto'` and two child views in it that also have an 'auto' height. The following example code works fine when...
Dynamically changing the items on the screen
I am wanting to put change the size of a item such a pictureView or a textLabel etc depending on the size of the screen. I know i can use ~~~~ height: 100, width: 100, ~~~~ But i am wanting something more along the lines of ~~~~ height:...
iPad option dialog height error. last item(s) not visible
The OptionDialog for iPad has problems with height. Run the program below, and you can see that the last items are not visible. The First problem is that not all the items are visible. (standard show on option dialog) I guess the problem is that a...
Scaling images for different resolutions
Hi, I am stuck on first steps of building UI. Let me try to explain the issue.. I have my own UI design with a header which contains logo on the left and a menu button on the right. this header have a background named headerback.png. There are...
Statusbar/notificationbar/footbar height? (available height)
Hello, Is there a way to get the actual height of the screen of a device? Ti.Platform.displayCaps.platformHeight gives me vertical resolution of the screen, not the actual real estate I have at my disposal. On iOS it's always 20 (40 @ retina), but on...
iPhone 5 - App gets boxed
On the iPhone 5, my app is getting, if the right term is, "viewboxed". It centers itself with a height of 460 (excluding the status bar). My code is as follows: ~~~~ var tabGroup = Ti.UI.createTabGroup({ width: Ti.UI.FILL, height:...
How to manipulate webview to fit every android platform?
It seems that I am having difficulty fitting a url page, and customizing it for a QVGA. I've tried: ~~~ <meta content="minimum-scale=1.0, width=device-width, maximum-scale=1.0, user-scalable=no" name="viewport"> ~~~ and...