读书人

如何使左右两个EditText下上滚动的时候

发布时间: 2013-02-04 10:50:22 作者: rapoo

怎么使左右两个EditText上下滚动的时候同时进行?
把两个EditText控件放进了一个LinerLayout里面,左右各一个,现在需要实现当右边的EditText里面内容上下滚动的时候左边的edittext的内容也跟着一起同步滚动。求各位高手指导!
[解决办法]
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="40dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<EditText
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
/>

<EditText
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
/>
</LinearLayout>
</ScrollView>
按8楼的第一个思路

读书人网 >Android

热点推荐