Android: setting dialog box sizes (what does "fill_parent" mean?)

The Android Developer's Guide for Creating a Custom Dialog defines the layout that begins:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
          android:id="@+id/layout_root"
          android:orientation="horizontal"
          android:layout_width="fill_parent"
          android:layout_height="fill_parent"
          android:padding="10dp"
          >

If I use this code, I get a dialog box that is in the center of the screen with about 40 pixels of the main view, visible on each side.

What exactly does fill_parent mean (for width and height)?

+3
source share
2 answers

Octavian Damiean, , , . java- onCreate ( super.onCreate(...) setContentView (...). , Java, : " mContext = getApplicationContext();" " mContext = this;", "dialog.show();", .

:

this

fill_parent, , .

, , . 10dip 0dip (- .) 100 dip :

alt text

, padding , .

+1

, . . 10dip ( , , , ) - . wrap_content, , .

fill_parent ViewGroup.LayoutParams.

0

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


All Articles