mã XML của tôi là ở đây,di chuyển lên xem văn bản chỉ khi bàn phím ảo mở trên android
<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/mainlayout" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:id="@+id/toplayout">
<ImageView
android:layout_width="wrap_content"
android:layout_height="100dp"
android:src="@drawable/bg" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:id="@+id/bottomlayout">
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="Enter value" />
</LinearLayout>
khi tôi thực hiện, tôi đã nhận như thế này,
sau thực thi, khi tôi nhập giá trị vào văn bản chỉnh sửa, bàn phím ảo đang mở và toàn bộ mainlayout đang cuộn lên, tôi nhận được như thế này
Nhưng tôi ngoại trừ bố cục trên cùng không cuộn lên, chỉ bố cục phía dưới hoặc chế độ xem văn bản cuộn lên. tôi mong đợi như thế này,
cách chỉ cuộn chế độ xem chỉnh sửa khi mở bàn phím ảo. ?
Hãy thử bằng cách thêm android: windowSoftInputMode = "adjustPan | adjustResize" cho các hoạt động trong file manifest của bạn. – vrs