【发布时间】:2017-08-16 13:11:24
【问题描述】:
我创建了具有 SwipeRefresh 的视图。我在底部还有两个按钮,因此当点击edittext时它们可以通过软键盘向上移动。问题是当文本框被点击时,按钮在顶部,但我认为 cardview 具有更高的 z-index 并且它们不完全可见
有一个结构:
<android.support.v4.widget.SwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/refresher"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:fillViewport="true">
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginTop="15px">
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/card_margin">
<!-- textboxes and others components here -->
</android.support.v7.widget.CardView>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_below="@+id/spinner"
android:layout_marginTop="5px"
android:gravity="center_horizontal|bottom"
android:paddingTop="2px">
<Button
android:theme="@style/AppTheme.ButtonAccent"
android:layout_width="0dip"
android:layout_weight="1"
android:layout_height="wrap_content"
android:id="@+id/startBtn"
android:text="START" />
<Button
android:theme="@style/AppTheme.ButtonPrimaryLight"
android:layout_width="0dip"
android:layout_weight="1"
android:layout_height="wrap_content"
android:id="@+id/continueBtn"
android:text="CONTINUE WORK" />
</LinearLayout>
</RelativeLayout>
</ScrollView>
</android.support.v4.widget.SwipeRefreshLayout>
我应该手动将按钮的 z 索引设置为更高,还是有更好的选择让它工作?
【问题讨论】:
-
为什么要去掉这个问题?
-
设置卡片视图下方的按钮
-
下面有
-
你在Activity标签的manifest中添加了这个android:windowSoftInputMode="adjustResize"
标签: android xml android-layout android-cardview swiperefreshlayout