xml代码如下
<?xml version="1.0" encoding="utf-8"?><FrameLayout android:id="@+id/FrameLayout01"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<ImageView android:id="@+id/ImageView01"
android:src="@drawable/p1"
android:layout_width="fill_parent" 
android:layout_height="fill_parent">
</ImageView>
</FrameLayout>虽然layout_width我设定的是fill_parent,但图片并没有自动拉伸填充满整个屏幕,顶部和底部都是黑条。请问下这是为什么啊?怎么样让图片自动拉伸以适应屏幕大小?

解决方案 »

  1.   

    自定义一个view的子类,然后再ondraw方法中 drawbitmap另外,设置为全屏模式.\
      

  2.   

    楼上,为什么imgaeView设定为fill_parent不能正确填充满屏幕啊?我在framelayout中又没有设定其他组件怎么会不能填充满呢?还有在哪里可以设定为全屏模式?谢谢了啊
      

  3.   

    没人知道为什么设定了fill_parent而imageview无法填充满整个framelayout吗?
      

  4.   

    设置一下你的minimalSDKversion试一下。