为了账号安全,请及时绑定邮箱和手机立即绑定

为什么没有自定义控件的时候,我们的图片显示很奇怪,并且还有一种拉伸的感觉了?

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"

    xmlns:tools="http://schemas.android.com/tools"

    android:layout_width="match_parent"

    android:layout_height="match_parent" >


    <HorizontalScrollView

        android:layout_width="match_parent"

        android:layout_height="match_parent" >


        <LinearLayout

            android:layout_width="wrap_content"

            android:layout_height="match_parent"

            android:orientation="horizontal" >


            <include layout="@layout/leftmenu" />


            <LinearLayout

                android:layout_width="match_parent"

                android:layout_height="match_parent"

                android:background="@drawable/qq" >


                <Button

                    android:layout_width="wrap_content"

                    android:layout_height="wrap_content"

                    android:text="点击到切换到菜单" />

            </LinearLayout>

        </LinearLayout>

    </HorizontalScrollView>


</RelativeLayout> <!-- HorizontalScrollView  和Scrollview 在内部只可以有一个控件,并且直接这么写过去之后,图片什么都会有些问题,有被拉生的感觉,可以自己试一试 -->


正在回答

1 回答

大概是图片的大小和模拟机或者手机的分辨率大小不一样导致的,一般使用图片都会使用以“.9.png”为后缀的图片来作为各种背景图或者图标背景,因为这种格式的图片是专门为APP制作的,就不会有那样拉伸的感觉了

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消
QQ5.0侧滑菜单
  • 参与学习       62512    人
  • 解答问题       315    个

本教程将带领大家通过自定义控件实现QQ5.0侧滑菜单

进入课程

为什么没有自定义控件的时候,我们的图片显示很奇怪,并且还有一种拉伸的感觉了?

我要回答 关注问题
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号