0

私はFrameLayout内にButtonとProgressBarを持っています。私のProgressBarは、Buttonが無効の場合にのみどのように表示されますか?私はアンドロイド6.0.1上で私のアプリを実行しています。Buttonが無効の場合にのみ、Buttonの上にあるProgressBarが表示されるのはなぜですか?

これは私のレイアウトファイルです:あなたはProgressBarの上昇を増やす必要があり

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:orientation="vertical" 
    android:padding="16dp"> 

    <FrameLayout 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content"> 

     <Button 
      android:id="@+id/btn_love" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:text="Love" /> 

     <ProgressBar 
      android:id="@+id/progress_bar" 
      style="?android:attr/indeterminateProgressStyle" 
      android:layout_width="22dp" 
      android:layout_height="22dp" 
      android:layout_gravity="right|center_vertical" 
      android:layout_marginRight="16dp" /> 
    </FrameLayout> 

</LinearLayout> 

enter image description here

+3

ボタンの幅がレイアウトの全幅をとるmatch_parentであるため、ボタンの後ろに隠れているためです。 – Drv

答えて

関連する問題