나는 스크롤 뷰에서 3 개의 로그인 컨트롤 (사용자 이름과 암호 용 텍스트 상자)을 표시하기 위해 HorizontalScrollView
을 맨 위에 둔 안드로이드 용 응용 프로그램을 설계하고 있습니다. 나는 당신이 아래 이미지에서 볼 수있는 것처럼 화면의 전체 너비를 차지하지 않는 하나의 사소한 결함을 제외하고는 원하는 것을 거의 달성했다. 너비를 fill_parent
으로 만들려면 어떻게해야합니까?레이아웃을 고치는 데 도움이 필요합니다
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:panel="http://schemas.android.com/apk/res-auto"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#CCC"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<org.miscwidgets.widget.Panel
android:id="@+id/mytopPanel"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
panel:animationDuration="1000"
panel:closedHandle="@drawable/top_switcher_collapsed_background"
panel:content="@+id/mypanelContent"
panel:handle="@+id/mypanelHandle"
panel:linearFlying="true"
panel:openedHandle="@drawable/top_switcher_expanded_background"
panel:position="top" >
<Button
android:id="@+id/mypanelHandle"
android:layout_width="wrap_content"
android:layout_height="33dip"
android:layout_gravity="center_horizontal" />
<HorizontalScrollView
android:id="@+id/mypanelContent"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<LinearLayout
android:id="@+id/linearLayout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<EditText
android:id="@+id/editTextUserName"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_margin="3dp"
android:layout_marginTop="6dp"
android:hint="@string/editUserName" >
</EditText>
<EditText
android:id="@+id/editTextPassword"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_margin="3dp"
android:hint="@string/editUserPwd" >
</EditText>
<TextView
android:id="@+id/textView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#323299"
android:gravity="center"
android:padding="4dip"
android:text="@string/drpDwnTxt"
android:textColor="#eee"
android:textSize="16dip"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:id="@+id/linearLayout1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_toRightOf="@+id/linearLayout"
android:orientation="vertical" >
<EditText
android:id="@+id/editTextUserName1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_margin="3dp"
android:layout_marginTop="6dp"
android:hint="@string/editUserName" >
</EditText>
<EditText
android:id="@+id/editTextPassword1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_margin="3dp"
android:hint="@string/editUserPwd" >
</EditText>
<TextView
android:id="@+id/textView1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#323299"
android:gravity="center"
android:padding="4dip"
android:text="@string/drpDwnTxt"
android:textColor="#eee"
android:textSize="16dip"
android:textStyle="bold" />
</LinearLayout>
</RelativeLayout>
</HorizontalScrollView>
</org.miscwidgets.widget.Panel>
</LinearLayout>
</FrameLayout>
내 대답이 도움이된다면 개선 할 것입니다. 덕분에 –