开发者

Linear layout and custom dialog

开发者 https://www.devze.com 2022-12-28 20:29 出处:网络
The button doesn\'t show in this layout(code below),image and textview are shown. I tried using relative layout but that doesn\'t help either. I\'m testing it on 1.5 emulator.

The button doesn't show in this layout(code below),image and textview are shown. I tried using relative layout but that doesn't help either. I'm testing it on 1.5 emulator.

 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/layout_root"
          android:orientation="vertical"
          android:layout_width="fill_parent"
          android:l开发者_StackOverflowayout_height="fill_parent"
          android:padding="10dp" >

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/neki"
          android:orientation="horizontal"
          android:layout_width="fill_parent"
          android:layout_height="fill_parent"

          >
<ImageView android:id="@+id/image"
           android:layout_width="wrap_content"
           android:layout_height="fill_parent"
           android:layout_marginRight="10dp"
           />
<TextView android:id="@+id/text"
          android:layout_width="wrap_content"
          android:layout_height="fill_parent"
          android:textColor="#FFF"
          android:text="Some text "
          />



 </LinearLayout>

 <Button android:id="@+id/gumbek"
    android:text="V redu"
    android:typeface="serif" android:textStyle="bold"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content" 
             /> 
  </LinearLayout>


The android:id="@+id/neki" View has pushed the button out of the screen because of android:layout_height="fill_parent".
You can change that to android:layout_height="wrap_content" to see the button and then read about android:layout_weight to do it right.

0

精彩评论

暂无评论...
验证码 换一张
取 消