完全不需要什么计算……
把能自己伸缩的部分放入ScrollView就好了……

解决方案 »

  1.   

    楼主 我也碰到过你的问题,直接在套一个 scrollview就行了。没想象的那么复杂
      

  2.   

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent" android:layout_height="fill_parent"
    android:orientation="vertical">
    <TextView android:text="12345" android:layout_width="fill_parent"
    android:layout_height="wrap_content" />
    <ScrollView android:layout_width="fill_parent"
    android:layout_height="fill_parent" android:layout_weight="1"
    android:fillViewport="true">
    <EditText android:layout_width="fill_parent"
    android:layout_height="fill_parent" />
    </ScrollView>
    <TextView android:text="12345" android:layout_width="fill_parent"
    android:layout_height="wrap_content" />
    </LinearLayout>你可以看下这个布局
      

  3.   

    这个都不用写代码。、。直接在xml中设置属性就可以了