2016-12-14 31 views
2

私はいくつかの場所でProgressBarを使用しているアプリケーションを持っています。ProgressBarが表示されない

<ProgressBar 
    android:id="@+id/pb_loading_indicator" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:indeterminate="true" 
    android:visibility="visible"/> 

すべての進捗バーは、どのアクティビティにも表示されません。 プログレスバーの色をプログラムで変更したり、xmlドロワブルを追加することですべてのソリューションを試しましたが、機能しません。

以下は技術的にプログレスバーがcolorAccentを取る必要があり、私のstyles.xml

<style name="MyAppCompatTheme" parent="Theme.AppCompat.Light.NoActionBar"> 
    <item name="android:colorPrimary">#FFFFFF</item> 
    <item name="android:colorPrimaryDark">#F1F1F1</item> 
    <item name="android:colorAccent">#EF5350</item> 
</style> 

ですが、そのはまったく表示されません。 は、サンプルビューを転記:

<RelativeLayout 
xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="match_parent" 
android:layout_height="match_parent"> 

<ImageView 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:id="@+id/logo" 
    android:src="@drawable/app_icon" 
    android:layout_centerHorizontal="true" 
    android:layout_marginTop="120dp"/> 

<TextView 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_centerHorizontal="true" 
    android:layout_below="@+id/logo" 
    android:textSize="18sp" 
    android:id="@+id/subtitle" 
    android:textColor="@color/secondary_text" 
    android:layout_marginTop="30dp" 
    android:text="QUICK BROWN FOX"/> 

<ProgressBar 
android:id="@+id/pb_loading_indicator" 
android:layout_width="wrap_content" 
android:layout_height="wrap_content" 
android:indeterminate="true" 
android:visibility="visible"/> 

プログレスバーは、アプリケーションの任意の活性の任意のビューが重なっていません。私はstyles.xmlに他のテーマを持っていませんし、マニフェストのアクティビティテーマもオーバーライドしていません。アプリケーションレベルのデフォルトテーマ。 プログレスバーだけで新しいアクティビティを作成しても、そのアクティビティは表示されません。 すべてのアクティビティデザインのプレビューと同様に、進行状況バーは正しく表示されますが、アプリケーションを実行するとそれは変わりません。 その他の情報が必要な場合は教えてください。

+0

post layoutここでは、プログレスバー –

+0

を使用しています。その上に別の 'View'がありますか?完全なレイアウトが役立ちます。 – Sunshinator

+0

が追加されました。私はアプリのいくつかの場所でそれを使用しています。私はそのようなインスタンスを1つ投稿しました – proy31

答えて

0

私は同じ問題に直面していましたが、他のビューのためにそこに隠れているかもしれません。私はあなたのケースでやったことは、XMLファイル内のマイナーチェンジ

<RelativeLayout 
xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="match_parent" 
android:layout_height="match_parent"> 

<ProgressBar 
android:id="@+id/pb_loading_indicator" 
android:layout_width="wrap_content" 
android:layout_height="wrap_content" 
android:indeterminate="true" 
android:visibility="visible"/> 


<ImageView 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:id="@+id/logo" 
    android:src="@drawable/app_icon" 
    android:layout_centerHorizontal="true" 
    android:layout_marginTop="120dp"/> 

<TextView 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_centerHorizontal="true" 
    android:layout_below="@+id/logo" 
    android:textSize="18sp" 
    android:id="@+id/subtitle" 
    android:textColor="@color/secondary_text" 
    android:layout_marginTop="30dp" 
    android:text="QUICK BROWN FOX"/> 

他の上にプログレスバーが、正確には何も、私にとってこの作品は、私はなぜ知らないでしょう。

関連する問題