How to change the position of edit text programmatically in android?

前端 未结 2 1457
萌比男神i
萌比男神i 2021-01-27 23:18

I\'m creating a number of edit texts next to each other programmatically using RelativeLayout. The default width of each edit text is wrap_content, but when the edit text reache

2条回答
  •  春和景丽
    2021-01-27 23:35

    What you can try. Not sure, if it will work. what you can do is calculate the width of screen on onCreate and make a check if the view exceeds that, make a new relative below the last one. To be honest linear layout will be more easier to maintain using weight property.

提交回复
热议问题