두 화면 사이에 편집 텍스트를 올바르게 배치하여 모든 화면 크기에서 전체 너비를 멋지게 배치 할 수있는 방법을 찾으려고합니다.안드로이드에서 편집 텍스트를 가로로 올바르게 배치하는 방법은 무엇입니까?
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="10dp">
<ImageView
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginLeft="5dp"
android:src="@drawable/country_india"/>
<EditText
android:layout_width="250dp"
android:layout_height="wrap_content"
android:hint="Leave a comment"
android:layout_gravity="bottom"/>
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/icon_pencil_2_small"
android:background="@color/white"
android:layout_gravity="bottom"
android:layout_marginBottom="5dp"/>
</LinearLayout>
다음
너희들이 도와 수 있기를 바랍니다
여기 내 XML입니다! . 당신이 android:layout_weight="1"
를 사용하는 대신에 당신이 맞게 EditText
에 맞게하려는 경우 폭을 고정해야
아 많은 덕분에 동료를 도왔다. 그럼 "무게"란 무엇입니까? –
기본적으로 Weight는 LinearLayouts와 함께 수평 또는 수직으로 만 작동합니다. Layout은 레이아웃의 높이 또는 너비를 기준으로 특정 무게로 가중치를 지정합니다. 예를 들어 세 가지 재료를 정렬하려면 동일한 크기로 고정해야합니다. linearLayout 아래의 모든 뷰는 동일한 크기를 갖습니다. – k0sh
그래, 남자를 할 것입니다. explaination을 주셔서 감사합니다 –