How to place button inside of edit text

后端 未结 11 686
我在风中等你
我在风中等你 2020-12-04 10:17

I want to place an image button inside of EditText, but I don\'t have Idea please tell me how to do so as shown in the figure . Thanks

11条回答
  •  天涯浪人
    2020-12-04 10:46

    In Material, there is that underline under EditText. In most applications the icons appear inside that underlining.

    For that purpose, just use padding

    android:paddingEnd = "@dimen/my_button_size"
    

    Don't forget paddingRight for sub 4.2 versions.

    
       ...
       
    
       
       ...
    
    

    It will limit the text to the image and the image will not overlap the text, however long the text may be.

提交回复
热议问题