-1
我有一個屏幕上的按鈕「下一步」通過鍵盤。我添加了滾動。如果鍵盤打開和空間不夠,我們需要使用滾動。但有一點空間滾動不顯示,並且按鈕被擠壓。按鍵在鍵盤上是擠壓。爲什麼滾動不起作用?
http://meson.ad-l.ink/8bXzYgJQW/thumb.png
http://polariton.ad-l.ink/7XGrCsMb4/thumb.png
在清單
<activity
android:name=".activity.register.RegisterPhoneActivity"
android:screenOrientation="portrait"
android:windowSoftInputMode="stateVisible|adjustResize"
/>
activity_register_phone.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical">
<include layout="@layout/w_toolbar" />
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingTop="6dp"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
android:fillViewport="true"
android:scrollbars="vertical"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="top"
>
<com.devspark.robototextview.widget.RobotoTextView
android:id="@+id/badge"
android:layout_width="@dimen/size_badge"
android:layout_height="@dimen/size_badge"
android:textSize="@dimen/text.16"
android:background="@drawable/circle_tv"
android:gravity="center"
android:text="1"
app:typeface="roboto_regular"
/>
<com.devspark.robototextview.widget.RobotoTextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/margin_10"
android:textSize="@dimen/text.26"
android:text="@string/enter_your_number"
android:layout_centerVertical="true"
android:layout_toRightOf="@+id/badge"
app:typeface="roboto_light"
/>
</RelativeLayout>
<com.devspark.robototextview.widget.RobotoTextView
android:id="@+id/description"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_20"
android:gravity="left"
android:textSize="@dimen/text.15"
android:textColor="@color/secondary_text_color"
android:text="@string/register_phone_description"
app:typeface="roboto_regular"
/>
<com.devspark.robototextview.widget.RobotoEditText
android:id="@+id/et_username_phone"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="phone"
android:textSize="@dimen/text.24"
android:layout_marginTop="@dimen/margin_22"
android:background="@drawable/edt_bg_selector"
app:typeface="roboto_regular"
/>
<com.devspark.robototextview.widget.RobotoTextView
android:id="@+id/content_info"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_6"
android:layout_marginLeft="@dimen/margin_15"
android:layout_marginRight="@dimen/margin_15"
android:gravity="center"
android:textColor="@color/url_grey_text_color"
android:textSize="@dimen/text.11"
app:typeface="roboto_regular"
tools:text="@string/register_phone_content_info"
/>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<com.devspark.robototextview.widget.RobotoButton
android:id="@+id/btn_next"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_16"
android:layout_gravity="bottom"
android:text="@string/btn_register_next_step"
android:textSize="@dimen/text.15"
android:enabled="false"
style="@style/ButtonStyle"
app:typeface="roboto_medium"
/>
</FrameLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>
我需要adjustResize –
爲什麼你在'frameLayout'這是'match_parent'的按鈕 – Anmol
刪除frameLayout並只使用按鈕可能會解決您的問題 – Anmol