为什么没有自定义控件的时候,我们的图片显示很奇怪,并且还有一种拉伸的感觉了?
<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 在内部只可以有一个控件,并且直接这么写过去之后,图片什么都会有些问题,有被拉生的感觉,可以自己试一试 -->