您的位置:首页 > 移动开发 > Android开发

一个关于android布局的问题!

2017-01-02 14:11 399 查看
<LinearLayout

            android:id="@+id/home_left_menu_id"

            android:layout_width="fill_parent"

            android:layout_height="match_parent"

            android:layout_weight="2"

            android:background="#A3A3A3"

            android:orientation="vertical" >

     

            <LinearLayout

                android:id="@+id/home_left_menu1_id"

                android:layout_width="fill_parent"

                android:layout_height="wrap_content"

                android:layout_weight="1"

                android:background="#836FFF"

                android:orientation="horizontal" >

                <LinearLayout

                    android:layout_width="match_parent"

                    android:layout_height="match_parent"

                    android:background="#09ff00"

                  	android:layout_weight="1" >

                    <ImageView

                        android:id="@+id/imageView1"

                        android:layout_width="wrap_content"

                        android:layout_height="wrap_content"

                        android:scaleType="centerInside"

                        android:layout_marginLeft="15dip"

                        android:layout_gravity="center_vertical"

                        android:src="@drawable/shouye" />

                    

                </LinearLayout>

                 <LinearLayout

                    android:layout_width="match_parent"

                    android:layout_height="match_parent"

                    android:background="#0ff0ff"

                    android:gravity="center_vertical"

                    android:layout_marginLeft="10dip"

                    android:orientation="vertical"

                  	android:layout_weight="1" >

                    <TextView

                        android:layout_width="wrap_content"

                        android:layout_height="wrap_content"

                        android:text="@string/home_ch"

                        android:textColor="#ffffff"

                        android:textSize="17sp" />

                    <TextView

                        android:layout_width="wrap_content"

                        android:layout_height="wrap_content"

                        android:text="@string/home_en"

                        android:textColor="#ffffff"

                        android:textSize="10sp" />

                </LinearLayout>

                

            </LinearLayout>

            <LinearLayout

                android:id="@+id/home_left_menu2_id"

                android:layout_width="fill_parent"

                android:layout_height="wrap_content"

                android:layout_weight="1"

                android:background="#7D26CD"

                android:orientation="vertical" >

            </LinearLayout>

            <LinearLayout

                android:id="@+id/home_left_menu3_id"

                android:layout_width="fill_parent"

                android:layout_height="wrap_content"

                android:layout_weight="1"

                android:background="#CD0000"

                android:orientation="vertical" >

            </LinearLayout>

    

            <LinearLayout

                android:id="@+id/home_left_menu4_id"

                android:layout_width="fill_parent"

                android:layout_height="wrap_content"

                android:layout_weight="1"

                android:background="#B3EE3A"

                android:orientation="vertical" >

            </LinearLayout>

            <LinearLayout

                android:id="@+id/home_left_menu5_id"

                android:layout_width="fill_parent"

                android:layout_height="wrap_content"

                android:layout_weight="1"

                android:background="#A4D3EE"

                android:orientation="vertical" >

            </LinearLayout>

        </LinearLayout>


以上是我的布局文件,放置图片和问题的那个layout被撑大了,请教一下,该怎么设置呢?

我这一段布局是一些 菜单,包括图片和文字,采用哪种布局更合适呢?
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: