가로로 정렬 된 텍스트 뷰와 다른 이미지 뷰 아래에 배치 된 이미지 뷰를 만들어야합니다. 문제는 그들이 수평으로 정렬되지 않는다는 것입니다. 어떻게 내가이 문제를 방지하기 위해 일을해야 ..android 이미지 뷰 아래에 객체 배치
내 코드 :
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:padding="5dp"
>
<ImageButton
android:id="@+id/imgBtnItem"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:scaleType="fitCenter"
android:background="@android:color/transparent">
</ImageButton>
<TextView
android:id="@+id/txtName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold"
android:textSize="9sp"
android:layout_below="@+id/imgBtnItem">
</TextView>
<ImageButton
android:id="@+id/imgBtnAdd"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/imgBtnItem"
android:layout_toRightOf="@+id/txtName"
android:background="@android:color/transparent"
>
</ImageButton>
</RelativeLayout>
당신이 한 일은 잘 모릅니다. 나는 아직도 안드로이드 레이아웃을 디자인하는 것을 정말로 싫어한다. 도와 줘서 고마워! – zxc
@zxc, 레이아웃을 서로 관련되게 사용하려면 relativelayout을 사용하십시오. 아래의 각 항목이 기본 이미지 뷰와 관련되는 경우에도 동일한 작업을 수행했습니다. – W4R10CK