如下所述:
情况一:
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<com.views.myView
android:layout_height="fill_parent"
android:layout_width="fill_parent" />
</LinearLayout>
显示:
情况二:
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<com.views.myView
android:layout_height="fill_parent"
android:layout_width="fill_parent" />
</ScrollView>
</LinearLayout>
显示:
怎么设置myView才能全部显示呢..

解决方案 »

  1.   

    图片好像不好显示啊..第一张图myView完全显示,第二个只显示了一小条
      

  2.   

    ScrollView加属性android:fillViewport="true"
      

  3.   

    自定义的View一定要重载实现public void onMeasure(int widthMeasureSpec, int heightMeasureSpec)函数,在其中调用setMeasuredDimension函数,设置自定义的View的宽和高。
      

  4.   

    2楼是有用 很方便 
    3楼的看起来很厉害 感觉麻烦就没试了(鄙人功夫不到家所致啊)
    我这里是绝对布局引起的 把layout_x和layout_y的设置去掉  什么都不用设置就显示完整了。