1
레이아웃 XML은 다음과 같습니다안드로이드 : layout_gravity는 수직으로 중앙에 아이 뷰를 넣어하지만 수평이 아닌
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@color/translucenter_dark" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="200dip"
>
<ProgressBar android:id="@+id/progressBar1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
></ProgressBar>
</LinearLayout>
</LinearLayout>
그리고 최종 레이아웃은 다음과 같습니다
왜 진행 막대가 넣어되지 않았습니다 수직 및 수평 중심. 기능 또는 버그입니까?
예. 그게 효과가 있다는 것을 이해합니다. 내가 이해하려고하는 것은 layout_gravity가 작동하지 않는 이유입니다. – pierrotlefou
ive 업데이트를 위해 내 anser을 – blessenm
+1 업데이트했습니다. 그러나 ProgressBar를 TextView로 바꾸면 Layout_gravity가 가로 방향으로 가운데에 배치되지 않습니다. – pierrotlefou