一个比较复杂的RelativeLayout布局---类似于表格布局

 

样式:一个比较复杂的RelativeLayout布局---类似于表格布局

 

 

 

 

<RelativeLayout
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:layout_margin="10dp"
                    android:background="@drawable/corner_record"
                    android:orientation="vertical" >

                    <View
                        android:id="@+id/center"
                        android:layout_width="2dp"
                        android:layout_height="@dimen/tophight"
                        android:layout_centerInParent="true"
                        android:background="@drawable/list_leftred" />

                    <View
                        android:layout_width="fill_parent"
                        android:layout_height="2dp"
                        android:layout_centerInParent="true"
                        android:background="#DB6A8D" />

                    <LinearLayout
                        android:id="@+id/top"
                        android:layout_width="wrap_content"
                        android:layout_height="@dimen/tophight"
                        android:layout_alignParentLeft="true"
                        android:layout_marginLeft="5dp"
                        android:layout_weight="1"
                        android:orientation="vertical" >

                        <TextView
                            android:id="@+id/period_tv"
                            style="@style/setting_body_text"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_weight="1"
                            android:gravity="center_vertical"
                            android:text="预计安全期:第3天" />

                        <LinearLayout
                            android:id="@+id/period_tv"
                            style="@style/setting_body_text"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_weight="1"
                            android:gravity="center_vertical" >

                            <TextView
                                style="@style/setting_body_text"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:gravity="center_vertical"
                                android:text="减重指数:" />

                            <RatingBar
                                android:id="@+id/lostweight_rating"
                                style="@style/articlelist_item_ratingbar_style"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:layout_gravity="center_vertical"
                                android:clickable="false"
                                android:focusable="false"
                                android:isIndicator="true"
                                android:rating="1"
                                android:stepSize="0.5" />
                        </LinearLayout>
                    </LinearLayout>

                    <LinearLayout
                        android:layout_width="wrap_content"
                        android:layout_height="@dimen/tophight"
                        android:layout_marginLeft="5dp"
                        android:layout_toRightOf="@id/center"
                        android:layout_weight="1"
                        android:orientation="vertical" >

                        <TextView
                            android:id="@+id/syllepsis_tv"
                            style="@style/setting_body_text"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_weight="1"
                            android:gravity="center_vertical"
                            android:text="受孕几率:55%" />

                        <LinearLayout
                            android:id="@+id/syllepsis_tv"
                            style="@style/setting_body_text"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_weight="1"
                            android:gravity="center_vertical" >

                            <TextView
                                style="@style/setting_body_text"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:text="美肤指数:" />

                            <RatingBar
                                android:id="@+id/skin_rating"
                                style="@style/articlelist_item_ratingbar_style"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:clickable="false"
                                android:focusable="false"
                                android:isIndicator="true"
                                android:rating="2"
                                android:stepSize="0.5" />
                        </LinearLayout>
                    </LinearLayout>
                </RelativeLayout>
关于其中的

<style name="articlelist_item_ratingbar_style" parent="@android :style/Widget.RatingBar">
        <item name="android:progressDrawable">@drawable/ratingbar_drawable</item>
        <item name="android:minHeight">@dimen/ratingbar_wh</item>
        <item name="android:maxHeight">@dimen/ratingbar_wh</item>
    </style>

你可能感兴趣的:(一个比较复杂的RelativeLayout布局---类似于表格布局)