android - gmail 类似进度条功能

标签 android navigation-drawer android-progressbar drawerlayout

enter image description here我正在创建一个类似进度条功能的 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/

相关文章:

java - 抽屉导航 : how to make the item direct you to a website. Android Studio

android - NPE : Attempt to invoke virtual method 'java.lang.CharSequence android.support.v7.widget.Toolbar.getTitle()' on a null object reference

java - 我重写的方法无法正常工作,代码进入方法,但不执行

android - Android 中 EditText 的不同颜色

android - 无法在 Dart/Flutter 多部分请求中发送正文参数

android - 在另一个布局中扩充一个布局

android - 如何创建一个重复的动画移动渐变drawable,就像一个不确定的进度?

android - 如何以编程方式创建 ProgressBar?

android - 如何实现android中间progressbar accessibility

android - 文本在 Android 中被截断以响应 native