확장 가능한 목록의 각 행에 버튼이 있고, 아래는 같은 줄에 있어야하는 텍스트보기와 버튼을위한 XML 레이아웃 파일이지만 텍스트는 "Assign Badge"는 너무 길어서 텍스트 크기를 작게 만들지 않으면 한 줄 = true로 맞지 않습니다. 텍스트가 절반 밖에 표시되지 않기 때문에 도움이되지 않습니다. 버튼이 두 줄에 나타납니다 ... 버튼을 넓힐 수있는 방법이 있습니까? 감사.안드로이드 단추 텍스트 동일 라인
<?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="55dip"
android:orientation="horizontal"
android:weightSum="1" >
<TextView
android:id="@+id/listItem"
android:layout_width="match_parent"
android:layout_height="35dp"
android:focusable="false"
android:focusableInTouchMode="false"
android:gravity="center_vertical"
android:layout_weight="0.2"
android:textSize="17dip"
android:paddingLeft="?android:attr/expandableListPreferredChildPaddingLeft" />
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:focusable="false"
android:focusableInTouchMode="false"
android:layout_weight="0.8"
android:textSize="8dp"
android:singleLine="true"
android:text="Assign Badge"
android:id="@+id/assign" />
</LinearLayout>
'width'는'weight'를 사용하기 때문에''0dp ''이어야합니다. – codeMagic