2011-04-09 70 views
0

什麼都我嘗試它總是結束了所以在連續第二個複選框不顯示,我不知道如何把AdMob的wedget屏幕

這個底部就是我未來目標是,由於時間:
Layout如何使這個佈局

回答

0

試試這個,祕訣是用相對佈局的最外層佈局和巢一些線性佈局,以獲得相應的複選框,對齊

 <?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent"> 
    <LinearLayout android:id="@+id/top_row" android:layout_alignParentTop="true" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_above="@+id/bottom_row"> 
     <EditText android:id="@+id/edit_text1" android:layout_height="wrap_content" android:layout_width="fill_parent" android:text="edit text"></EditText> 
      <LinearLayout android:id="@+id/check_box_holder" android:orientation="horizontal" android:layout_height="wrap_content" android:layout_width="fill_parent"> 
       <LinearLayout android:id="@+id/check_box_left_col" android:orientation="vertical" android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_weight="1"> 
        <CheckBox android:id="@+id/CheckBox01" android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_alignParentLeft="true" android:text="CheckBox01"></CheckBox> 
        <CheckBox android:id="@+id/CheckBox02" android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_alignParentLeft="true" android:text="CheckBox02"></CheckBox> 
       </LinearLayout> 
       <LinearLayout android:id="@+id/check_box_right_col" android:orientation="vertical" android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_weight="1"> 
        <CheckBox android:id="@+id/CheckBox03" android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_alignParentLeft="true" android:text="CheckBox03"></CheckBox> 
        <CheckBox android:id="@+id/CheckBox04" android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_alignParentLeft="true" android:text="CheckBox04"></CheckBox> 
       </LinearLayout> 
      </LinearLayout> 
      <Button android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" android:text="button1"> </Button> 
      <EditText android:id="@+id/edit_text2" android:layout_height="wrap_content" android:layout_width="fill_parent" android:text="edit text2"></EditText> 
      <Button android:id="@+id/button2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" android:text="button2"> </Button> 

    </LinearLayout> 
    <LinearLayout android:id="@+id/bottom_row" android:layout_alignParentBottom="true" android:orientation="horizontal" android:layout_width="fill_parent" android:gravity="center" android:layout_height="wrap_content" android:background="#88ffffff"> 
     <com.admob.android.ads.AdView  
      android:id="@+id/ad_block" 
      android:layout_margin="1px" android:layout_width="350dip" android:layout_gravity="center" android:layout_height="58dip"/> 
    </LinearLayout> 
</RelativeLayout> 
+0

非常好。你有一個xml編輯器來幫助生成這個,還是全部是手動的? (如果它是一個編輯工具,請哪一個?) – shellter 2011-04-09 02:53:17

+0

沒什麼特別的,只是SDK附帶的eclispe Android佈局編輯器。我主要使用xml /文本編輯器,然後使用WYSIWIG視圖來驗證排列好的東西。 – mmeyer 2011-04-09 04:07:33