Android 응용 프로그램을 개발하려고하지만 GUI 디자인에 문제가 있습니다. 스크린 샷의 다음 부분은 내 문제입니다 (빨간색과 파란색 선은 Android 디버그 옵션에 의해 생성되었습니다). 당신이 볼 수 있듯이RelativeLayout에서보기가 겹치지 않도록하기
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/caption"
android:layout_below="@+id/caption" >
<ImageButton
android:id="@+id/button_edit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_alignParentRight="true"
android:src="@drawable/content_edit"
style="?android:attr/borderlessButtonStyle" />
<TextView
android:id="@+id/myText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:text="@string/num_placeholder"
android:textAppearance="?android:attr/textAppearanceLarge" />
</RelativeLayout>
에서, 텍스트 뷰 myText를가하여 ImageButton의 button_edit 겹치는 :
이
는 코드입니다. 간단한 해결책은 RelativeLayout 대신 LinearLayout을 사용하는 것입니다.- 내가
- 가 나는 또한
나는 (분명히 편집 버튼의 왼쪽에) 레이아웃의 나머지 부분을 채우기 위해 텍스트를 필요 오른쪽에있는 편집 버튼을해야 문제가 있다는 것입니다 myText의 layout_width를 'fill_parent'로 설정하려고했지만 편집 버튼의 왼쪽에 전체 화면을 채 웁니다.
예상되는 동작 (두 줄 텍스트 뷰가되는) 대신 'button_edit' 이
이 사람이 나를 도울 수를 중복 높이를 증가 myText를 할 것인가? 텍스트 뷰 레이아웃에 감사
왜 'RelativeLayout'을'LinearLayout'으로 구현할 수 있습니까? – sriramramani