我正在创建一个类似进度条功能的 gmail。操作栏和进度条之间似乎有一些空间。
代码如下
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- As the main content view, the view below consumes the entire
space available using match_parent in both dimensions. -->
<FrameLayout
android:id="@+id/content_frame"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<ProgressBar
android:id="@+id/progressBar1"
style="?android:attr/progressBarStyleHorizontal"
android:indeterminateOnly="true"
android:layout_width="wrap_content"
android:layout_height="?android:attr/actionBarSize" />
<ListView
android:id="@+id/left_drawer"
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:choiceMode="singleChoice"
android:divider="@android:color/transparent"
android:dividerHeight="0dp"
android:background="#111"/>
</android.support.v4.widget.DrawerLayout>
最佳答案
DrawerLayout
应该只包含两个子元素:用于内容的 FrameLayout
和用于抽屉的 fragment
。因此 ProgressBar
应该位于动态创建的内容中。
关于android - gmail 类似进度条功能,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24911656/