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.

RecyclerView inside ScrollView is not working

I'm trying to implement a layout which contains RecyclerView and ScrollView at the same layout. Layout template: <RelativeLayout> &…

android android-layout android-scrollview android-recyclerview android-cardview
How to lay out Views in RelativeLayout programmatically?

I'm trying to achieve the following programmatically (rather than declaratively via XML): <RelativeLayout...> <TextView ... android:id="@+id/…

android android-layout android-view android-relativelayout
How to center the elements in ConstraintLayout

I am using ConstraintLayout in my application to make applications layout. I am trying to a create a screen wheren …

android android-layout android-constraintlayout
Why fragments, and when to use fragments instead of activities?

In Android API 11+, Google has released a new class called Fragment. In the videos, Google suggests that whenever possible (link1, …

android android-layout android-fragments android-activity android-3.0-honeycomb
How do I remove lines between ListViews on Android?

I'm using two ListViews like this: <ListView android:id="@+id/ListView" android:text="@string/Website" android:layout_height="30px" …

android android-layout listview
How can I create a border around an Android LinearLayout?

I have one big layout, and one smaller layout inside of it. How do I create a line border around …

android android-layout android-linearlayout
Android draw a Horizontal line between views

I have My Layout like below: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/…

android android-layout listview android-intent
How to adjust layout when soft keyboard appears

I would like to adjust/re-size the layout when the soft-keyboard activated, as below: Before and After: Found couple resources …

android android-layout android-softkeyboard
Defining a percentage width for a LinearLayout?

I want to define a percentage width (70%) for a LinearLayout that contains some buttons, so that I can center it …

android android-layout
Can the Android layout folder contain subfolders?

Right now, I'm storing every XML layout file inside the 'res/layout' folder, so it is feasible and simple to …

android xml android-layout gradle build.gradle