Android 进度条不显示';我不能在API 24上出现
我可能错过了一些非常明显的东西。我已经试了两个小时来简单地显示一个进度条,进度不确定 这是我的布局Android 进度条不显示';我不能在API 24上出现,android,android-layout,android-progressbar,Android,Android Layout,Android Progressbar,我可能错过了一些非常明显的东西。我已经试了两个小时来简单地显示一个进度条,进度不确定 这是我的布局 <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:ads="http://schemas.android.com/apk/res-auto" an
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_horizontal"
android:orientation="vertical"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin">
<LinearLayout
android:id="@+id/loginForm"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/smallMargin"
android:orientation="vertical">
<EditText
android:id="@+id/textUsername"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/prompt_email"
android:inputType="textAutoCorrect"
android:maxLines="1"
android:singleLine="true" />
<EditText
android:id="@+id/textPassword"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/prompt_password"
android:imeActionId="6"
android:imeActionLabel="@string/action_sign_in"
android:imeOptions="actionUnspecified"
android:inputType="textPassword"
android:maxLines="1"
android:singleLine="true" />
<Button
android:id="@+id/loginButton"
style="?android:textAppearanceSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="16dp"
android:text="@string/action_sign_in"
android:textStyle="bold" />
</LinearLayout>
<ProgressBar
android:id="@+id/progressBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/medium_margim"
android:indeterminate="true"
android:visibility="visible" />
<com.google.android.gms.ads.AdView
android:id="@+id/adView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
ads:adSize="MEDIUM_RECTANGLE"
ads:adUnitId="@string/banner_ad_unit_id"
/>
</LinearLayout>
到目前为止,我的代码只是加载layout.xml
在布局设计器中,一切看起来都很好,但进度条却没有
有人有想法吗?
我学习了3个不同的教程,什么都没有
========================================更新==========================
我下载了API27图像,它在emulator上运行良好。。。但我的应用程序的目标是API 21
我的手机是24岁,没有显示进度条检查手机动画是否已启用,并在
系统设置/开发者选项中设置为1x
检查手机的动画是否已启用,并在“开发选项”中将其设置为x1
。我理解正确吗?你只在一台真正的设备上测试了代码?@Jantzilla,如果你把这些信息作为答案,我可以把它标记为正确!!它仍然有点不同的模拟器(更快),但我显示了良好的@RafaelLima。很高兴我能帮上忙。你能补充一点关于为什么这样做的信息吗?我很好奇这是否只是因为调试问题,或者发布的apk可能有问题。我的理解是默认的不确定进度是一个动画,确保手机动画已启用可以确保功能。我假设这是一个调试问题。我很感谢您的反馈,如果遇到同样的问题,我会将这些信息打包以备将来使用。