ProgressBar와 세 개의 TextView가 포함 된 xml에 LinearLayout이 있습니다. 내 프로그램을 실행할 때LinearLayout은 TextView가 아닌 ProgerssBar만을 보여줍니다.
는하지만, 난 그냥 ProgressBar의 레이아웃 여기
내부에 배치 한 사람들은 XML 스크립트입니다 TextViews을 볼 ProgressBar를가 할 수없는 무엇입니까 : 여기
<!--LinearLayout contains Progress Bar and TextView-->
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:gravity="center"
android:orientation="vertical"
android:background="#fff"
android:layout_weight="2">
<ProgressBar
android:id="@+id/progressBar"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_centerInParent="true"
android:max="500"
android:progress="0"
android:progressDrawable="@drawable/circular_progress" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="13"
android:textStyle="bold"
android:id="@+id/txt1"
android:gravity="center"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="WEEKS TODAY"
android:id="@+id/txt2"
android:layout_marginTop="5dp"
android:gravity="center"
android:layout_below="@+id/txt1"
android:layout_centerHorizontal="true" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="183 days to go"
android:id="@+id/txt3"
android:gravity="center"
android:layout_centerHorizontal="true"
android:layout_below="@+id/txt2"
android:layout_alignRight="@+id/txt2"
android:layout_alignEnd="@+id/txt2" />
</LinearLayout>
하면 완료 main.xml :
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation= "vertical"
android:layout_width= "fill_parent"
android:layout_height= "fill_parent" >
<LinearLayout
android:orientation= "horizontal"
android:layout_width= "fill_parent"
android:layout_height= "fill_parent"
android:layout_weight= "1" >
<!--Profile Pic-->
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_weight="2"
android:background="#aa0000">
</LinearLayout>
<!--Previous Button-->
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_weight="1"
android:background="#000">
</LinearLayout>
<!--LinearLayout contains Progress Bar and TextViews-->
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:gravity="center"
android:orientation="vertical"
android:layout_weight="2">
<ProgressBar
android:id="@+id/progressBar"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_centerInParent="true"
android:max="500"
android:progress="0"
android:progressDrawable="@drawable/circular_progress" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="13"
android:textStyle="bold"
android:id="@+id/txt1"
android:gravity="center"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="WEEKS TODAY"
android:id="@+id/txt2"
android:layout_marginTop="5dp"
android:gravity="center"
android:layout_below="@+id/txt1"
android:layout_centerHorizontal="true" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="183 days to go"
android:id="@+id/txt3"
android:gravity="center"
android:layout_below="@+id/txt2"
android:layout_alignRight="@+id/txt2"
android:layout_alignEnd="@+id/txt2" />
</LinearLayout>
<!--Next Button-->
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_weight="1"
android:background="#000">
</LinearLayout>
</LinearLayout>
<LinearLayout
android:orientation= "vertical"
android:layout_width= "fill_parent"
android:layout_height= "fill_parent"
android:layout_weight= "1"
android:background= "#000">
</LinearLayout>
</LinearLayout>
진행률 막대가 모든 레이아웃을 차지합니다. 'android : layout_width = "fill_parent" android : layout_height = "fill_parent"진행률 표시 줄에서 이것을'wrapcontent '로 변경하십시오. –
@Raghunandan 예 진행률 막대 내에서만 TextViews를 표시하기 때문에 내 ProgressBar가 각각의 LinearLayout의 전체 너비와 높이를 차지하고 싶습니다 ... – Sonali