android - EditText overflowing into button -


i have edittext , button in fragment activity.

i'm facing 2 issues.

1) cannot put button, below edittext.

here, screenshot :

enter image description here

2) whenever paste lengthy text in edittext, button overlapping text. please @ screenshot.

enter image description here

here xml :

      <framelayout>          <edittext             android:layout_width="wrap_content"             android:layout_height="wrap_content"             android:id="@+id/edittext"             android:text="@string/url"             android:hint="@string/hint"             android:layout_margintop="200dp"             android:layout_gravity="center_horizontal|top" />          <button             android:layout_width="wrap_content"             android:layout_height="wrap_content"             android:text="@string/track"             android:id="@+id/button"             android:layout_gravity="center"             />         </framelayout> 

how solve issue. please?

instead of using framelayout, might want consider using relativelayout. can following:

for edittext, use following attribute:

// says widget should vertically , horizontally @ center of container android:layout_centerinparent="true" 

for button, use following attribute:

android:layout_below:"@id/edittext" 

the attributes have mentioned replace

android:layout_gravity

attributes both widgets have used.

also edittext lose

android:layout_margintop="200dp"

attribute layout_centerinparent attribute automatically center it.


Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -