手机屏幕适配

测试:320*480(中兴)--

<ScrollView
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_below="@id/top"
        android:layout_marginTop="@dimen/margin_max" >


        <RelativeLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content" >


            <ImageView
                android:id="@+id/image"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentTop="true"
                android:layout_centerHorizontal="true"
                android:layout_marginBottom="@dimen/margin_max"
                android:layout_marginLeft="@dimen/margin_max"
                android:layout_marginRight="@dimen/margin_max"
                android:background="@drawable/exclamation_mark" />


            <TextView
                android:id="@+id/red_text1"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_below="@id/image"
                android:layout_marginBottom="@dimen/margin_max"
                android:layout_marginLeft="@dimen/margin_max"
                android:layout_marginRight="@dimen/margin_max"
                android:text="@string/people_else1"
                android:textColor="@color/red"
                android:textSize="@dimen/text_15" />


            <TextView
                android:id="@+id/red_text2"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_below="@id/red_text1"
                android:layout_marginLeft="@dimen/margin_max"
                android:layout_marginRight="@dimen/margin_max"
                android:text="@string/people_else2"
                android:textColor="@color/string_bgblue_main"
                android:textSize="@dimen/text_15" />
        </RelativeLayout>
    </ScrollView>

显示正常,如果把: android:layout_marginLeft="@dimen/margin_max"
                android:layout_marginRight="@dimen/margin_max"

拿出来放到RelativeLayout标签中就显示居左。

但是在480*800,也就是屏幕宽度在480以上的手机上显示正常。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值