2016-06-08 1 views
2

원형 진행 막대가 있지만 표시되지 않는이 레이아웃이 있습니다. 나는의 코드를 가지고 : https://stackoverflow.com/a/5261727/2995941Android : 서클 진행 막대가있는 레이아웃 요소 이동 순서

enter image description here

이 내 레이아웃 XML입니다 :

<?xml version="1.0" encoding="utf-8"?> 
<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" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    tools:context="pidaas.vicomtech.org.facerec.MainActivity"> 


<SurfaceView 
    android:id="@+id/surfaceView" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    /> 

<ImageView 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:id="@+id/imageView" 
    android:layout_centerHorizontal="true" 
    android:src="@drawable/calibration_head_b" /> 

<android.support.design.widget.FloatingActionButton 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:text="Process" 
    android:src="@drawable/unlock" 
    android:id="@+id/process_act" 
    android:layout_alignTop="@+id/photo_act" 
    android:layout_toRightOf="@+id/photo_act" 
    android:layout_toEndOf="@+id/photo_act" 
    android:layout_marginLeft="63dp" 
    android:layout_marginStart="63dp" /> 


<android.support.design.widget.FloatingActionButton 
    android:id="@+id/photo_act" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:clickable="true" 
    android:src="@drawable/icon_camera_128" 
    app:layout_anchorGravity="bottom|right|end" 
    android:layout_marginBottom="55dp" 
    android:layout_alignParentBottom="true" 
    android:layout_alignParentLeft="true" 
    android:layout_alignParentStart="true" 
    android:layout_marginLeft="103dp" 
    android:layout_marginStart="103dp" /> 

<ProgressBar android:indeterminate="true" 
    android:layout_width="50dp" android:layout_height="50dp" 
    android:id="@+id/marker_progress" style="?android:attr/progressBarStyle" 
    android:layout_gravity="center_vertical|center_horizontal"/> 

</RelativeLayout> 

진행 표시 줄이 표시되지 않는 요소를 부동 같은이 진행 막대를 넣어 순서는? Android 버전이 스타일을 적용하지 않을 수 있습니까? android : attr/progressBarStyle?

내 안드로이드 지원 버전은 다음과 같습니다

  • com.android.support:appcompat-v7:23.2.1

  • com.android.support:design:23.2.1

미리 감사드립니다.

답변

3

문제점을 해결했습니다 :

문제가 progressbar 요소에 있습니다.

주문이 올바르게되었습니다. background atribute, android : background = "@ null"을 추가했습니다. 이제 센터에서 볼 수 있습니다.

이것은 최종 xml 파일입니다.

<?xml version="1.0" encoding="utf-8"?> 
<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" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    tools:context="pidaas.vicomtech.org.facerec.MainActivity"> 


    <SurfaceView 
     android:id="@+id/surfaceView" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     /> 

    <ImageView 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:id="@+id/imageView" 
     android:layout_centerHorizontal="true" 
     android:src="@drawable/calibration_head_b" /> 

    <android.support.design.widget.FloatingActionButton 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:text="Process" 
     android:src="@drawable/unlock" 
     android:id="@+id/process_act" 
     android:layout_alignTop="@+id/photo_act" 
     android:layout_toRightOf="@+id/photo_act" 
     android:layout_toEndOf="@+id/photo_act" 
     android:layout_marginLeft="63dp" 
     android:layout_marginStart="63dp" /> 


    <android.support.design.widget.FloatingActionButton 
     android:id="@+id/photo_act" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:clickable="true" 
     android:src="@drawable/icon_camera_128" 
     app:layout_anchorGravity="bottom|right|end" 
     android:layout_marginBottom="55dp" 
     android:layout_alignParentBottom="true" 
     android:layout_alignParentLeft="true" 
     android:layout_alignParentStart="true" 
     android:layout_marginLeft="103dp" 
     android:layout_marginStart="103dp" /> 


    <ProgressBar android:indeterminate="true" 
     android:layout_width="100dp" android:layout_height="100dp" 
     android:id="@+id/marker_progress" style="?android:attr/progressBarStyle" 
     android:visibility="visible" 
     android:foregroundGravity="center_horizontal" 
     android:background="@null" 
     android:layout_centerVertical="true" 
     android:layout_centerHorizontal="true" /> 
</RelativeLayout> 
관련 문제