Layout components Horizontally in Android

Posted by xximjasonxx on Stack Overflow See other posts from Stack Overflow or by xximjasonxx
Published on 2010-12-04T14:21:36Z Indexed on 2010/12/22 1:54 UTC
Read the original article Hit count: 494

Filed under:
|
|
|

Greetings all,

I am trying to create a layout in Android for a notification. My goal is to have the following displayed:

1: Icon for the app 2: Vertically stacked LinearLayout with Session title and Room to be held in 3: The start time of the session

The problem I am facing is that #2 has a variable width depending on the size of the title. Hardcoding a width would look terrible if the user turns the handset sideways and goes into Landscape mode. Therefore here is my question:

How can I layout three components horizontally in Android such that #1 and #3 are left and right aligned respectively, and #2 simply takes the space remaining?

Thanks in advance

© Stack Overflow or respective owner

Related posts about android

Related posts about Xml