Which Android control to use?

I am taking my first steps in Android programming.

My application is to create records in a database. For this task, I created a new activity. Everything is fine, but I donโ€™t really like how it looks.

The emulator currently shows this:
Current layout

I would like to have something similar to the "New Contact" activity:

  • Buttons at the bottom of the window, not under other controls (I hope I find out myself)
  • Buttons inside a beautiful โ€œrectangleโ€ as shown in the screenshot (which control is located here?)
  • When the soft keyboard is displayed, the buttons should โ€œmove upโ€. If there is not enough space there, the entire area should be scrollable (I'll try to figure it out too)

A sample can be seen here:
alt text

" "? .

+3
4

ListView, - RelativeLayout LinearLayout, . : ( - ).

, commonsware - .

+2

, , - hierarchyviewer .

, Android, - . , , LinearLayout style="@android:style/ButtonBar", . , , @android:drawable/bottom_bar . SDK - , data/res/drawable-hdpi data/res/drawable-mdpi .

+4

, , , , , , . , , , :

<activity android:name=".MyActivity" android:windowSoftInputMode="resize" />

, , . , ; , - .

+1

You can put them in LinearLayout and assign a weight from 1 to each of the buttons. Also, if you have your own phone / or you want to see the user interface of the application in the emulator - there is a very cool call to the tool hierarchy http://developer.android.com/guide/developing/tools/hierarchy-viewer.html and you can see how you like the user interface of the application.

0
source

Source: https://habr.com/ru/post/1727055/


All Articles