linearlayout

Scrolling with Multiple ListViews for Android

I'm completely stumped on this one. I have three different lists that need to be displayed on the screen. It's completely possible that the lists will extend past the bottom edge of the screen, so I would need scrolling. I've tried using a ScrollView with a LinearLayout child, and putting my ListViews in the LinearView, but all of the...

Android LinearLayout fill-the-middle

I have a vertical, set height (300px) LinearLayout (LL) with 3 nested LLs. 1 and 3rd are set with android:layout_height="wrap_content" and the middle one with android:layout_height="fill_parent". To my dismay, 3rd LL gets pushed out with 2nd one filling parent layout right to the bottom. How do I achieve desired effect since I want poten...

TextView inside a LinearLayout, crash with a long string

Using Android, here is part of a layout xml file: <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical" android:textColor="#191919"> <TextView android:id="@+id/someTextField" android:layout_width="fill_parent" android:layout_height="wrap_cont...

Equivalent to "overflow" property in LinearLayout on Android SDK?

I've been trying to create a color LinearLayout object (1) within another LinearLayout object (2), while having (1) not display beyond the bounds of (2) - in short, I wish to assign the equivalent of the CSS overflow:hidden property to LinearLayout (2) so that LinearLayout (1) doesn't bleed beyond the edges of (2). <LinearLayout> <!-...

Including a background drawable foobars my layout in Android. Ideas why?

If I don't include a background in my root layout then everything renders as I expect: However, if I add JUST ONE LINE adding in a background then the layout goes completely haywire: The relevant bit of the XML layout is: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width ="fill_paren...

Android: LinearLayout addView Animation

I currently have a working Android program that programatically adds views to a LinearLayout. I would like those views to be animated in and cannot find any good resources on figuring out how to do this. Could someone point me in the right direction? Thanks, John ...

Making child ListView scroll

Hello I am trying to make a terminal type app that is wider than the actual android screen. A listview is great except that I don't want the text to wrap. If the text is wider than the screen I want it to print the full text and then the user can scroll over horizontally if they want to see what was printed off the screen. Just FYI this ...

frequent problem in android view, Error parsing XML: unbound prefix

Hello, I have frequent problem in android view, Error parsing XML: unbound prefix on Line 2. <?xml version="1.0" encoding="utf-8"?> <LinearLayout android:orientation="vertical" android:id="@+id/myScrollLayout" android:layout_width="fill_parent" android:layout_height="wrap_content"> <TextView android:layout_height="wrap_content" a...

Adding a CheckBox to ListView item prevents it from being able to receive ItemClick

In the Adapter for the ListView, I return a LinearLayout, in which I add a Checkbox, a ImageView and a TextView. This basically constructs a ListView, in which each item contains a Checkbox, a ImageView and a TextView. However the strange thing is that if I don’t add the Checkbox, then ListView receives onItemClick event correctly, as lo...

How can I swap LinearLayouts from XML during runtime (Android)?

Hi, I am trying to create an option in my code to change layouts using preferences. I already have the two layouts created in XML, but I can't figure out how to swap between the two during runtime. I would like to cause it to check during onResume() since it is called directly after returning from the Preferences screen and when startin...

Android TableLayout question: get a fixed-width right column?

(Edited: I'm one step further than before) I've been trying to get a simple 2-column TableLayout going where I have a LinearLayout in my left column that I dynamically add elements to which fills up the horizontal space except for the fixed 100px right column. Here's what I have so far which works for me IF the LinearLayout contains mo...

Android - Fill Layout with Buttons

Just a quick question about how you would go about implementing this. I want there to be buttons at the bottom of the screen, but if the screen size is larger, more buttons would be added. For example, at a small screen size, there might be 4-5 buttons at the bottom, but if you ran it on a tablet or something similar, there would be ma...

xml vs java LinearLayout fills

the xml version below properly handles height and width and the java doesn't what is the java missing? xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="fill_parent" android:layout_width="fill_parent" android:orientation="horizontal"> <...

Refreshing a LinearLayout after adding a view

Hi I'm trying to add views dynamically to a linearlayout. I see through getChildCount() that the views are added to the layout, but even calling invalidate() on the layout doesn't give me the childs showed up. Am I missing something? ...

Android: Add view onclick after the view itself

I have a LinearLayout View with a OnClickhandler and I want to add a View after the LinearLayout programatically when the OnClick event is fired. public void onClick(View view) { LayoutInflater li = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE); LinearLayout info = (LinearLayout) li.inflate(R.layout.infolaye...

Android LinearLayout Visibility issues with Animation

Hello, I am trying to swap two LinearLayouts by setting their visibility properties to "VISIBLE" and "GONE" respectively. I am also using an animation while the layouts are being swapped. The animation completes successfully and I see the correct layout. However, the previous Layout which has its visibility property set to "GONE" still ...

LinearLayout of a WebView and a Button.

Hi, I recently struggled with an apparently simple Android layout: I wanted a WebView above a Button. It worked fine with the following parameters: WebView: Height: wrap-content Weight: unset (by the way, what is the default?) Button: Height: wrap-content Weight: unset However if the web page became too big it spilled out ove...

Android Update Layout Content

I'm looking for a way to update a layout's content with a new view. Is there any way to easily do this. It would be similar to how tabs work, but I don't want to have to get into extending the current tab structure if I don't have to. The final result would be a few buttons that would switch the content in a specific linearlayout for e...

Linear Layout and weight in Android

I always read about this funny weight value in the Android documentations. Now I want to try it for the first time but it isn't working at all. As I understand it from the documentations this layout: <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal...

Changing size of content in HorizontalScrollView when phone is rotated by overriding onConfigurationChanged

Hello fellow Androiders... I have a problem with resizing content in a HorizontalScrollView when the phone is rotated. I'm overriding onConfigurationChanged in my activity containing the HorizontalScrollView, since I want to handle the resizing myself. However, I'm having great problem finding where i should put the resizing of the con...