Home > Software engineering >  Can we actually create 2 drawableLeft in android?
Can we actually create 2 drawableLeft in android?

Time:12-09

I was wondering if there is a way using which we can create 2 drawableLeft in our android layout. I have a scenario where i need to use 2 drawables. Anyone with any suggestions, drop them down please.

Edit: This is the layout that i want to design.

layout

CodePudding user response:

If you are using this view in only one place then you could just use LinearLayout with horizontal layout. and place 1 ImageView, TextView or Spinner [as per your requirement if the country code is selectable then you should use spinner instead of TextView for country code view] TextView and style them as needed. As in following picture:

enter image description here

If you need to use this layout in multiple place you could implement Custom View with the same layout file. Check how to create Custom View from this answer.

  • Related