2014-10-22 3 views
0

로그인 버튼을 클릭하면 표시되는 진행 막대 회 전자가 있음, 스피너가 화면에 표시되어있는 동안 회 전자 뒤에있는 요소가 희미하거나 어두워 지도록합니다. 내 레이아웃 파일이 현재 다음과 같습니다애니메이션을로드하는 동안 어둡게/흐리게 배경 요소 - Android

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:paddingBottom="@dimen/activity_vertical_margin" 
    android:paddingLeft="@dimen/activity_horizontal_margin" 
    android:paddingRight="@dimen/activity_horizontal_margin" 
    android:paddingTop="@dimen/activity_vertical_margin" 
    tools:context="apps.kusasa.biz.MainActivity" > 

    <EditText 
     android:id="@+id/EditText01" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:layout_above="@+id/editText2" 
     android:layout_alignLeft="@+id/editText2" 
     android:layout_alignRight="@+id/editText2" 
     android:ems="10" 
     android:hint="Username" 
     android:inputType="text" /> 

    <EditText 
     android:id="@+id/editText2" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_above="@+id/loginBtn" 
     android:layout_centerHorizontal="true" 
     android:ems="10" 
     android:hint="Password" 
     android:inputType="textPassword" > 

     <requestFocus /> 
    </EditText> 

    <Button 
     android:id="@+id/loginBtn" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_alignLeft="@+id/EditText01" 
     android:layout_alignParentBottom="true" 
     android:layout_alignRight="@+id/EditText01" 
     android:layout_marginBottom="67dp" 
     android:text="Login" /> 

    <ImageView 
     android:id="@+id/imageView1" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_above="@+id/EditText01" 
     android:layout_alignParentLeft="true" 
     android:layout_alignParentRight="true" 
     android:layout_alignParentTop="true" 
     android:src="@drawable/pics_logo" /> 

    <ProgressBar 
     android:id="@+id/progressBar1" 
     style="?android:attr/progressBarStyleLarge" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_above="@+id/editText2" 
     android:layout_centerHorizontal="true" 
     android:layout_marginBottom="77dp" /> 

</RelativeLayout> 

내 버튼 클릭 방법 :

@Override 
public void onClick(View v) { 
    switch (v.getId()) { 
    case R.id.loginBtn: 
     spinner.setVisibility(View.VISIBLE); 
     // etc 
    } 
} 

어떻게 이것을 달성합니까? 감사!

답변

1

회 전자가 어둡게하려는 요소와 동일한 레이아웃에있을 때 힘들어집니다. 스피너를 별도로 (부모) 레이아웃으로 이동시킨 다음 알파 채널이있는 배경색을 상대 채널에 적용합니다. 예 : # 99000000

+0

어떤 유형의 레이아웃을 사용 하시겠습니까? –

+0

FrameLayout은 어떨까요? 요소를 쌓을 수 있습니다. – Carsten

+0

이 경로는 화면을 채우지 않는 framelayout, 더 이상 레이아웃의 중간에 있지 않은 진행 막대 회 전자 및 더 많은 임시 해결책을 필요로하는 기타 많은 문제를 나타냅니다 . –