Top "Android-layout" questions

A layout defines the visual structure for a user interface, such as the UI for an activity, fragment or app widget.

Android list view inside a scroll view

I have an android layout which has a scrollView with a number of elements with in it. At the bottom …

android android-layout android-scrollview
How to set layout_gravity programmatically?

My question is simple, How to set my buttons layout_gravity programmatically? I found this on internet, but it simply …

android android-layout
What is the difference between match_parent and fill_parent?

I'm a little confused about two XML properties: match_parent and fill_parent. It seems that both are the same. …

android android-layout
Android: set view style programmatically

Here's XML: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" style="@style/LightStyle" android:layout_width="fill_…

android android-layout
How to implement a ViewPager with different Fragments / Layouts

When I start an activity which implements viewpager, the viewpager created various fragments. I want to use different layouts for …

android android-layout android-fragments android-viewpager fragmentpageradapter
How to programmatically set drawableLeft on Android button?

I'm dynamically creating buttons. I styled them using XML first, and I'm trying to take the XML below and make …

java android android-layout android-2.2-froyo
Add padding on view programmatically

I am deveoping Android v2.2 app. I have a fragment. In the onCreateView(...) callback of my fragment class, I inflate …

android android-layout android-emulator android-widget padding
Android LinearLayout Gradient Background

I am having trouble applying a gradient background to a LinearLayout. This should be relatively simple from what I have …

android android-layout android-linearlayout gradient
Android - Dynamically Add Views into View

I have a layout for a view - <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:…

android dynamic view android-layout
Android: why setVisibility(View.GONE); or setVisibility(View.INVISIBLE); do not work

I want my DatePicker and the button to be invisible in the begining. And when I press my magic button …

java android android-layout android-view android-datepicker