2014-07-20 3 views
0

사용자 정의 진행률 표시 줄을 디자인하려하지만 모서리를 숨길 수 없습니다. 검은 색 원으로 강조 표시된 모서리 근처에 흰색 패치를 강조 표시하려고합니다. Android : 사용자 정의 progressbar의 모서리 숨기기

enter image description here

나는 다음 코드를 시도하지만, 여기

customProgressbar.getWindow().setBackgroundDrawable(new ColorDrawable(0)); 

작동하지 않습니다 내 당김 파일을 여기에

<shape xmlns:android="http://schemas.android.com/apk/res/android" > 

<solid android:color="@color/pale_orange" /> 
<stroke android:color="@android:color/transparent"/> 
<corners 
    android:bottomLeftRadius="10dp" 
    android:bottomRightRadius="10dp" 
    android:topLeftRadius="10dp" 
    android:topRightRadius="10dp" /> 

<padding 
    android:bottom="3dp" 
    android:left="3dp" 
    android:right="3dp" 
    android:top="3dp" /> 
</shape> 

내 XML 레이아웃 파일입니다

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:background="@color/white" 
android:orientation="vertical" > 

<RelativeLayout 
    android:background="@drawable/progressbar_background" 
    android:layout_centerInParent="true" 
    android:layout_width="100dp" 
    android:layout_height="100dp" > 

    <TextView 
     android:id="@+id/textView1" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_alignParentTop="true" 
     android:layout_centerHorizontal="true" 
     android:layout_marginTop="5dp" 
     android:layout_marginBottom="10dp" 
     android:text="Loading.." 
     android:textColor="@color/white" /> 

    <ProgressBar 
     android:id="@+id/progressBar1" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_below="@+id/textView1" 
     android:layout_centerHorizontal="true" /> 

</RelativeLayout> 

</RelativeLayout> 

해결책을 얻는 데 도움주세요. 많은 감사합니다!

+0

게시물이 줄을 교체해야한다고 생각 흰색 배경을 제거하는 사용자 정의 모양을 사용한 xml 레이아웃 –

+0

@Rod_Algonquin 편집 된 질문을 참조하십시오. XML 레이아웃 파일을 업데이트했습니다. – Kaustubh

답변

1

문제 :

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:background="@color/white" 
android:orientation="vertical" > 

당신이 RelativeLayout 따라서 당신에게 흰색 배경 위에 샘플 이미지에서 수와 같은 흰색주고 부모의 배경 색상을 볼 수있다.

솔루션 :

세트 투명 RelativeLayout의 배경 색상은

android:background="@android:color/transparent" 
+0

감사합니다. 얼마나 어리석은 실수였습니까 !!! : – Kaustubh

+0

@Kaustubh 고맙습니다. 감사합니다. –

+0

예 Upvoted, ans를 수락합니다 .5 분 동안 ans를 수락 할 수 없습니다 :// – Kaustubh

0

나는 당신이 당신의 상대 레이아웃

android:background="@color/white" 
for 
android:background="@android:color/transparent"