我对Android布局设计感到困惑。我想达到以下图像中的布局:Android LinearLayout:Layout中的布局
但下面的代码产生这样的形象:
我的代码
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="50sp"
android:layout_below="@+id/view"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:background="@drawable/bg_shadow"
android:animateLayoutChanges="true"
android:layout_marginTop="5dp"
android:id="@+id/detailsLay">
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/repeat"
android:id="@+id/repeatCheckBox"
android:longClickable="false"
android:textColor="@android:color/background_light"
android:paddingTop="15sp"
android:paddingRight="15sp"
android:paddingLeft="1sp"
android:paddingBottom="15sp" />
<TextView
android:layout_width="30dp"
android:layout_height="20sp"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="@string/sat"
android:id="@+id/satTextView"
android:layout_gravity="center_vertical|right"
android:textColor="@android:color/holo_orange_light"
android:layout_marginLeft="2sp" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/arrowDown"
android:src="@android:drawable/arrow_down_float"
android:layout_gravity="center_vertical" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/everyday"/>
</LinearLayout>
</LinearLayout>
使用'relativeLayout'代替 – suitianshi 2014-09-06 04:53:36
使用'RelativeLayout'否则使用'LinearLayour2'的不同布局 – SilentKiller 2014-09-06 04:55:55