Questions tagged as 'android-xml'

1
answer

Why is it recommended to use "sp" instead of "dp" in text sizes?

Given that when we use the drive sp in TextView a warning always appears like this:    Should use "sp" instead of "dp" for text sizes This SOpt response shows exactly the difference between units of measure: Doubt over px,...
asked by 21.09.2016 / 20:04
1
answer

android text gradient

Is it possible to create a gradient in the text (and not the background ) of a textView using XML only? I know that using shader can do with code ( here >) Is it possible to do this using only XML ?     
asked by 24.05.2016 / 15:43
2
answers

What's the difference between gravity and layout_gravity on Android?

In the customization of layout properties in Android Studio, I noticed that there is gravity and layout_gravity , both have the name gravity , so I'm a little confused as to its features. That is, what are the differences b...
asked by 07.10.2016 / 22:56
2
answers

How to apply attributes of a ViewGroup from parent to child in android studio?

How do children in a ViewGroup inherit an attribute from the parent? For example, I would like to set layout_marginTop="16dp" to all TextView daughters <LinearLayout android:layout_width="match_parent" android:layout_heigh...
asked by 27.10.2017 / 15:39
2
answers

How to change the color of StatusBar?

How do I change the color of this part of the app? I wanted everything from the same green color like this one down.     
asked by 07.07.2017 / 14:47
1
answer

What is the difference between a toolbar and another view?

I'm learning how to use toolbar in Android development and I've seen that using it is very similar to other views , I saw that you can put it without being at the top, that you can put items inside it. example), type a layout, then...
asked by 20.10.2017 / 06:28
2
answers

How to set placeholder in EditText?

I created a small Android app containing only one activity. In it I put two EditText components. I want to set placeholders in them, as in HTML5 inputs, but I can not find a solution.     
asked by 06.09.2017 / 09:28
1
answer

Concatenate an @string and a text in XML

I have a string called "key" and wanted to add the sequence numbers next to it in some textviews , but I do not know how to concatenate it in XML. For example: android:text="@string/key" + "1" android:text="@string/key" + "2" android:text="@...
asked by 01.03.2018 / 23:50
1
answer

Parameters via xml for custom ImageView

I have% custom%, which will work as ImageView . On the screen, I will have several of this item, but different colors. I wonder if it is possible to pass a color parameter in the xml declaration. Example: <com.example.utils.S...
asked by 28.10.2015 / 12:41
1
answer

Change color of a Button that already has an Assigned Background

Hello, in my application there is a table (Alert Dialog) that will be used to select the color of a component. In this table there are several equal buttons with the background already defined so that they have a round style. For this, I used an...
asked by 02.11.2017 / 17:47