Android: ProgressBar가 활동에서 이상하게 보입니다. (Android: ProgressBar looks strange in activity)


문제 설명

Android: ProgressBar가 활동에서 이상하게 보입니다. (Android: ProgressBar looks strange in activity)

progressBarnew</a></p>

새 디자인을 더 오래되어 보이는 progressBar를 표시하고 싶지 않아 시작하시겠습니까?

이것은 내 활동에 사용하고 있는 테마입니다.

<ProgressBar
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:id="@+id/progressBar"
    android:layout_centerInParent="true"/>

이것은 내가 내 레이아웃 내 항목의 가시성을 변경합니다. 클릭하면 모든 것을 숨기고 progressBar를 표시하는 로그인 버튼이 있습니다. 로그인 버튼을 클릭하면 화면이 돌아가서 몇 초 동안 상단에 상태 표시줄을 표시하고 progressBar는 이전 비물질 테마 progressBar를 반영합니다. 상태바가 다시 사라지면 화면에 새로운 progressBar가 나타납니다.

항목의 가시성이 변경되면 테마가 존중되지 않는다고 생각합니까?


참조 솔루션

방법 1:

I think by mistake, I put in this style and attached it to the progressBar:

    style="@style/Widget.AppCompat.ProgressBar"

Deleting it make it revert back to the material theme progressBar

EDIT:

After further investigations, it is actually due to the progressBar included within the facebook SDK. I had to take it out by following the advice in this thread: Android: How to hide progress circle in Facebook login copied and pasted here for your convenience.

I had the same problem with facebook sdk 4.x. When I click the facebook login button the Facebook Activity appears translucent but it shows a progress bar. Luckily we can disable this progress bar in the theme. So the Facebook Activity is declared as

<activity
    android:name="com.facebook.FacebookActivity"
    android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
    android:label="@string/app_name"
    android:theme="@android:style/Theme.Translucent.NoTitleBar" />

All we have to do is create a style that inherits from Theme.Translucent.NoTitleBar and hides the progress bar:

<style name="FullyTranslucent" parent="android:Theme.Translucent.NoTitleBar">
    <item name="android:progressBarStyle">@style/InvisibleProgress</item>
</style>

<style name="InvisibleProgress">
    <item name="android:visibility">gone</item>
</style>

Now set the theme of the activity to our new theme:

<activity
    android:name="com.facebook.FacebookActivity"
    android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
    android:label="@string/app_name"
    android:theme="@style/FullyTranslucent" />

Voila! The ProgressBar before login is gone.

방법 2:

This is a good solution

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

(by SimonSimonIvan Rancic)

참조 문서

  1. Android: ProgressBar looks strange in activity (CC BY‑SA 2.5/3.0/4.0)

#android-progressbar #Android






관련 질문

목록 보기 항목의 보기는 화면에서 보기를 스크롤한 후 원래 상태로 돌아갑니다. (listview item's view returns to original state after scroll the view off the screen)

Android의 비동기 클래스에서 FTP 다운로드에 진행률 표시줄을 표시하는 방법은 무엇입니까? (How to show the progress bar in FTP download in async class in Android?)

Android에서 진행률 표시줄의 ListView (ListView of Progress Bars in android)

안드로이드에서 24시간 SeekBar 또는 ProgressBar를 만드는 방법 (How to create 24hour SeekBar or ProgressBar in android)

Android: ProgressBar가 활동에서 이상하게 보입니다. (Android: ProgressBar looks strange in activity)

Android에서 기본 ProgressDialog 원 색상을 변경하는 방법 (How to change default ProgressDialog circle color in android)

Android: 사이에 공백이 있는 맞춤 원 ProgressBar (Android: Custom circle ProgressBar with spaces in between)

정적 수평 진행률 표시줄 Android (Static horizontal progress bar android)

Android progressBar setVisibility()가 작동하지 않음 (Android progressBar setVisibility() not working)

비동기 작업의 게시 진행률 (Publishing progress in async task)

BaseActvity/BaseFragment의 ProgressBar 관리 (ProgressBar management in BaseActvity/BaseFragment)

진행 중인 경고 대화 상자가 닫히거나 취소되지 않음 (Alertdialog running ongoing dosen't dismiss or cancel)







코멘트