【发布时间】:2015-12-22 09:07:56
【问题描述】:
我有一个带有 Tabs 和 ViewPager 的片段。在 ViewPager 的片段中,我有一个 EditText,当我尝试输入文本时,ActionBar 已展开,我看不到 EditText。
这是带有 Tabs 和 ViewPager 的片段的布局:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.rey.material.widget.TabPageIndicator
style="@style/TabPageIndicator"
android:id="@+id/tabs"
android:layout_height="@dimen/tabs_height"
android:layout_width="match_parent"
android:clipToPadding="false" />
<View
android:id="@+id/shadow"
android:layout_width="match_parent"
android:layout_height="8dp"
android:background="@drawable/shadow"
android:layout_below="@+id/tabs"/>
<android.support.v4.view.ViewPager
android:id="@+id/pager"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/shadow"/>
这是工具栏的代码:
<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
style="@style/ToolBarStyle" android:layout_width="match_parent"
android:layout_height="wrap_content" android:background="?attr/colorPrimary"
android:minHeight="@dimen/abc_action_bar_default_height_material"
android:fitsSystemWindows="true"/>
这是 ToolBarStyle:
<style name="ToolBarStyle" parent="">
<item name="android:elevation">@dimen/toolbar_elevation</item>
<item name="popupTheme">@style/ThemeOverlay.AppCompat.Light</item>
<item name="theme">@style/ThemeOverlay.AppCompat.Dark.ActionBar</item>
</style>
这可能是问题所在?
提前致谢。
【问题讨论】:
-
你能发布完整的代码吗?
-
可以添加xml包含收费条码吗?
-
我在问题中添加了工具栏的代码和工具栏的样式。谢谢
-
你能改变工具栏的高度吗?android:layout_height="@dimen/abc_action_bar_default_height_material"
-
android:layout_height="?actionBarSize" 到您的工具栏。
标签: android android-layout android-fragments android-actionbar android-edittext