here에서 찾을 수있는 Android 용 부트 스트랩 라이브러리를 사용하고 있습니다. 필자의 응용 프로그램에 라이브러리를 가져 왔지만 버튼이 인 경우 전체 화면 너비가이되지 않습니다. Ive는 버튼을 나란히 놓고 android:layout_weight="1"
을 사용했지만 버튼이 왼쪽으로 이동하고 늘어지지 않습니다. 심지어 android:layout_width="match_parent"
을 사용해 보았지만 버튼의 높이가 커졌습니다. Android 버튼이 화면 너비에 미치지 못함
이
내가 설정 한 경우 일 것입니다XML 코드
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:bootstrapbutton="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="20sp" >
<TextView
android:id="@+id/textView1"
android:layout_width="318dp"
android:layout_height="wrap_content"
android:text="Send Pin To Email id."
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="@+id/textView2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Enter Your Email Id Below"
android:textAppearance="?android:attr/textAppearanceMedium" />
<com.beardedhen.androidbootstrap.BootstrapEditText
android:id="@+id/et_email"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:ems="10"
android:hint="[email protected]"
android:inputType="textEmailAddress"
bootstrapbutton:be_roundedCorners="true" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="horizontal"
android:paddingBottom="15sp" >
<com.beardedhen.androidbootstrap.BootstrapButton
android:id="@+id/OK"
style="@style/AppBaseTheme"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="5dp"
android:text="OK"
bootstrapbutton:bb_icon_left="fa-envelope"
bootstrapbutton:bb_roundedCorners="true"
bootstrapbutton:bb_size="medium"
bootstrapbutton:bb_type="default" />
<com.beardedhen.androidbootstrap.BootstrapButton
android:id="@+id/cancel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="10dp"
android:text="CANCEL"
bootstrapbutton:bb_icon_left="fa-times"
bootstrapbutton:bb_roundedCorners="true"
bootstrapbutton:bb_size="medium"
bootstrapbutton:bb_type="default" />
</LinearLayout>
<View
android:layout_width="fill_parent"
android:layout_height="1dp"
android:background="@android:color/darker_gray" />
<TextView
android:id="@+id/textView3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="15sp"
android:text="Got your Pin?Enter it below."
android:textAppearance="?android:attr/textAppearanceMedium" />
<com.beardedhen.androidbootstrap.BootstrapEditText
android:id="@+id/et_pin"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:ems="10"
android:hint="XXXX"
android:inputType="number"
bootstrapbutton:be_roundedCorners="true" />
<com.beardedhen.androidbootstrap.BootstrapButton
android:id="@+id/b_check"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="10dp"
android:text="Check"
bootstrapbutton:bb_icon_left="fa-check"
bootstrapbutton:bb_roundedCorners="true"
bootstrapbutton:bb_size="medium"
bootstrapbutton:bb_type="default" />
</LinearLayout>
어느 utton 당신은 streched해야합니까? 확인/취소 또는 확인 하시겠습니까? –
@androidKiller 둘 다 실제로 .. 나는 'ok/cancel'을 나란히 (같은 크기로 너비를 채우는 것) 나란히 놓고 화면의 너비를 채우기 위해 '확인'하고 싶습니다. –
주로 텍스트 크기에 사용되는 sp 대신 여백과 여백에 dp를 사용하십시오. –