Top "Android-xml" questions

Android projects use XML in several ways: defining the project and components, building layouts, defining animations, creating menus and specifying resources (static and dynamic) for the project.

How to retrieve 2D array from xml string resource for Android?

Suppose I have stored a 2 dimensional array in android resource as shown below. How can I get them in a …

java android xml multidimensional-array android-xml
marginTop does not work with ConstraintLayout and wrap_content

In my Fragment I have a ConstraintLayout with layout_height="wrap_content" and I would like to have a margin …

android android-layout android-xml android-constraintlayout android-wrap-content
Programmatically change color of shape in layer list

How can I programmatically change the color (#000000) of a shape in a layer list? Here is my layer list: <…

android android-layout android-fragments android-activity android-xml
Resource arrays

Is there a way to define an array in XML in which the elements are resource references? For example (it …

android string android-xml android-resources
Android: toggle text color of ToggleButton

To create a custom ToggleButton, I've defined a new style in /res/values/styles.xml: <style name="myToggleButton"> &…

android android-xml togglebutton
What is android:layout_marginStart

I would like to add some space between the left display border and an ImageView. Android SDK made me aware …

android android-layout android-view android-xml
How to combine BottomAppBar + FAB with BottomNavigationView

I want to use the FloatingActionButton, along with its behaviour when anchored on a BottomAppBar, on top of a BottomNavigationView. …

android android-layout android-xml bottomnavigationview android-bottomappbar
Set layout_column and layout_row in GridLayout programmatically

I have a GridLayout (not GridView) where I want to add some views with a special row and column inex. …

android android-xml android-gridlayout
Rectangle shape with two solid colors

I'd like to create a rectangle shape with two solid colors (horizontally) to achieve something like this: I heard about …

android android-xml shape
Android: Placing ImageView on overlap between layouts

I am trying to place an ImageView on the overlap point between two layouts. In the picture below, my goal …

android android-layout android-xml