XML 디자인에서 두 단추 중 하나를 아무 문제없이 작동하지만 두 번째 단추는 장치에서 보이지 않습니다. (두 개의 단추는 XML의 ListView에 있습니다.) 누군가가 왜 이런 일이 일어 났는지 이해하도록 도울 수 있으면 행복 할 것이고, 고칠 수는 있습니다. 감사.장치에서 안드로이드 단추가 보이지 않음
XML은 (설정 단추가 문제 버튼입니다) -
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="gg.gg.MainActivity">
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:text="Tasks"
android:background="#e2e2e2" />
<ListView
android:id="@+id/list_todo"
tools:listitem="@layout/item_todo"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<Button
android:layout_width="60dp"
android:layout_height="60dp"
android:src="@drawable/settings"
android:background="@drawable/settings"
android:onClick="ButtonClick"
android:id="@+id/settings"
android:layout_above="@+id/add_task"
android:layout_alignParentEnd="true" />
<Button
android:layout_width="60dp"
android:layout_height="60dp"
android:id="@+id/add_task"
android:src="@drawable/addtask"
android:background="@drawable/addtask"
android:layout_alignParentBottom="true"
android:layout_alignEnd="@+id/settings" />
</RelativeLayout>
코드 요소에 원하는 가중치를 부여하십시오. –
XML을 더미 프로젝트에 붙여 넣었습니다. 드로어 블에서 이상한 일을하지 않는다고 가정하면 둘 다 서로 위에 나타납니다. 어떤 Android 버전을보고 있습니까? –
@ChrisWard API 22 – proli2