나는 안드로이드 응용 프로그램을 쓰고 있어요. 다음은 XML 레이아웃입니다된다tablerow의 버튼 크기가 올바르지 않습니다. (안드로이드)
<ScrollView android:id="@+id/ScrollView01"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="left|top|bottom|right"
android:layout_marginTop="80dip"
android:layout_marginLeft="0dip"
android:layout_marginRight="0dip"
android:layout_marginBottom="60dip"
>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/centerlayout"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="left|right|top|bottom"
android:layout_marginRight="20dip"
android:layout_marginLeft="10dip"
android:layout_marginBottom="120dip" >
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TableRow>
<Button android:text="Button"
android:layout_column="0"
android:id="@+id/bookmarkbutton"
android:layout_width="230dip"
android:layout_height="30dip"
android:background="@drawable/red_btn"
android:padding="14dp"
></Button>
</TableRow>
</TableLayout>
</LinearLayout>
</ScrollView>
내가 그것을 실행하면 다음과 같은 화면이 표시됩니다, "버튼"을 버튼을 layout_gravity을 = "왼쪽"
을하지만 안드로이드를 추가 할 때 크기 감소 및 보여준다 I 안드로이드 의한 버튼의 폭을 변경하는 경우
주의 사항 : layout_width = "30dip"은 그 작은 버튼이 표시
하지만 더 큰 크기로 변경하면 크기가 올바르게 적용되지 않고 최대 너비가 두 번째 이미지와 동일합니다.
나는 그것에 새로운 텍스트 뷰를 추가 마지막으로 경우,
ScrollView android:id="@+id/ScrollView01"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="left|top|bottom|right"
android:layout_marginTop="80dip"
android:layout_marginLeft="0dip"
android:layout_marginRight="0dip"
android:layout_marginBottom="60dip"
>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/centerlayout"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="left|right|top|bottom"
android:layout_marginRight="20dip"
android:layout_marginLeft="10dip"
android:layout_marginBottom="120dip"
>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TableRow>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/subjecttext"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:lineSpacingExtra="10dip"
android:padding="14dp"
/>
</TableRow>
<TableRow>
<Button android:text="Button"
android:layout_column="0"
android:id="@+id/bookmarkbutton"
android:layout_width="20dip"
android:layout_height="30dip"
android:background="@drawable/black_btn"
android:padding="14dp"
></Button>
</TableRow>
</TableLayout>
</LinearLayout>
</ScrollView>
그것은 다음과 같은 이미지를 표시하지 않고, 버튼의 크기가 더 이상 변경 가능 통해. 뭐가 잘못 됐는지 말해 줄래?
![enter image description here](https://i.stack.imgur.com/uuygw.png)
가 대단히 감사합니다. 그것은 잘 작동합니다. 날 구해 줬어. –여러분을 환영합니다! 해피 코딩! – ihrupin