【发布时间】:2015-10-06 21:09:08
【问题描述】:
我想打开软键盘并在键盘上方滚动编辑文本。但它必须在scrollView中。现在我有错误的结果: video
我不想滚动顶部视图。我只想滚动编辑文本。
我使用这个主题:
<style name="Theme.TransparencyDemo" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:windowTranslucentStatus">true</item>
<item name="android:windowTranslucentNavigation">true</item>
</style>
编辑:
布局:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:weightSum="1"
android:background="#142e06">
<TextView
android:layout_width="100dp"
android:layout_height="30dp"
android:text="New Text"
android:id="@+id/textView"
android:background="#ff4018"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"/>
<EditText
android:layout_width="300dp"
android:layout_height="wrap_content"
android:id="@+id/editText"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="150dp"/>
</RelativeLayout>
【问题讨论】:
-
你在 AndroidManifest.xml 中为你的 Activity 设置了 android:windowSoftInputMode="adjustPan" 吗?
-
我试过了,没用
-
set android:windowSoftInputMode="adjustResize" 也没用?
-
我也试过了,没用
标签: android android-softkeyboard android-scrollview