简体   繁体   English

ProgressBar在模拟器而不是手机上运行

[英]ProgressBar working on emulator and not on phones

I've got this code: 我有以下代码:

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="wrap_content"
android:layout_width="56dp"
android:minWidth="56dp">
<ProgressBar android:layout_width="32dp"
    android:layout_height="32dp"
    android:layout_gravity="center"/>

The spinning progressbar runs fine when i run my application in Droid4X emulator, but it doesn't show any spinning progressbar on my phone. 当我在Droid4X模拟器中运行应用程序时,旋转进度条运行良好,但手机上没有显示任何旋转进度条。 Tried another phone too, no progressbar. 也尝试了另一部手机,没有进度栏。 Can you help me finding my problem? 你能帮我找到我的问题吗? Thanks 谢谢

To be precise it works on every API except 23. To be even more precise, it works if i put 确切地说,它适用于除23之外的所有API。更精确地说,如果我把它

        style="@android:style/Widget.ProgressBar.Small"

您的代码可以在我的手机上正常工作,我认为问题不在此代码中。

It is also working on my Android Moto G. And there is if problem persists than do not run on emulator rather connect your phone with Android studio and enable 它也可以在我的Android Moto G上运行。如果问题仍然存在,则可能无法在模拟器上运行而不是将手机与Android Studio连接并启用

Developer Mode 开发者模式

and than select device as your phone. 然后选择设备作为手机。 If any problem will be it will debug. 如果有任何问题,它将进行调试。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM