小编Nit*_*pta的帖子

Scrollview在显示android软键盘时向上推

我在scrollView中有一个editext.当editext获得焦点并显示软键盘时,ScrollView会自动向上推.

我试过了

android:windowSoftInputMode="adjustResize" android:windowSoftInputMode="adjustPan"

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/sign_in_or_sign_up_bg" >

<RelativeLayout
    android:id="@+id/headerlayout"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentTop="true"
    android:background="@drawable/headerbox_title" >

    <ImageButton
        android:id="@+id/backImgBtn"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_centerVertical="true"
        android:background="@null"
        android:src="@drawable/backarrow" />
</RelativeLayout>

<ScrollView
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_below="@+id/headerlayout"
    android:fillViewport="true" >

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_gravity="center"
        android:gravity="center"
        android:orientation="vertical" >

        <ImageButton
            android:id="@+id/profilePicImgBtn"
            android:layout_width="@dimen/sign_up_profile_pic"
            android:layout_height="@dimen/sign_up_profile_pic"
            android:layout_gravity="center_horizontal"
            android:background="@null"
            android:scaleType="centerCrop"
            android:src="@drawable/attach_image" />

        <EditText
            android:id="@+id/userNameEdt"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="@dimen/sign_in_small_margin"
            android:background="@drawable/text_box"
            android:hint="Username"
            android:imeOptions="actionNext"
            android:padding="@dimen/edt_padding"
            android:singleLine="true"
            android:textSize="@dimen/edt_hint" />

        <EditText
            android:id="@+id/emailEdt"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="@dimen/sign_in_small_margin"
            android:background="@drawable/text_box"
            android:hint="Email"
            android:imeOptions="actionNext"
            android:inputType="textEmailAddress"
            android:padding="@dimen/edt_padding"
            android:singleLine="true"
            android:textSize="@dimen/edt_hint" />

        <EditText
            android:id="@+id/passwordEdt"
            android:layout_width="wrap_content" …
Run Code Online (Sandbox Code Playgroud)

android adjustpan

7
推荐指数
1
解决办法
4278
查看次数

语音到文本应用程序需要哪个最低安卓版本

我已经完成了将语音转换为文本的编码.我只想知道这需要哪个最低版本的android.

android speech-to-text

5
推荐指数
1
解决办法
1508
查看次数

标签 统计

android ×2

adjustpan ×1

speech-to-text ×1