The text comes up on the photo.how to set element padding-right text from mic image
Asked
Active
Viewed 63 times
2

Android Developer
- 284
- 1
- 9
-
2how you add that image? using drawable right? Please add your code for more detail – Shweta Chauhan Aug 08 '20 at 07:24
-
check this: https://stackoverflow.com/questions/32609710/textinputlayout-how-to-give-padding-or-margin-to-hint – Davi Aug 08 '20 at 07:26
-
1upload your Xml code – Shivam Singh Aug 08 '20 at 07:32
1 Answers
0
Instead of relying on padding, I suggest you to learn ConstraintLayout. This layout is most widely used these days. It sets constraints (like rules) for parent layout and your components. It is much better than padding, which needs to be set differently for different screen sizes and densities.
To use ConstraintLayout, follow these steps:
- Put your
TextView
andImageView
underConstraintLayout
. - Select both of them and Right Click.
- Select
Chains
->Create Horizontal Chain
.
This set constraints on both of the components and they will never overlap.
For in-depth understanding of ConstraintLayout, check:
- ConstraintLayout (Google Documentations)
- Exploring the new Android ConstraintLayout (Medium Tutorials)

gpl
- 1,380
- 2
- 8
- 24