저는 사용자가 사진 위에 페인트, 이동 및 일부 모양을 재조정하는 안드로이드 응용 프로그램을 가지고 있습니다. 이 페이지에서 내 화면 레이아웃은로드 된 사진과 그 아래에 세로보기로 구성된 버튼으로 구성됩니다.Android - 캔버스로 그려지는 항목 위에보기를 설정하십시오.
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:id="@+id/linear" >
<LinearLayout
android:id="@+id/buttons"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center"
android:layout_alignParentBottom="true">
<ImageView
android:id="@+id/draw"
android:layout_width="80dp"
android:layout_height="50dp"
android:clickable="true"
android:src="@drawable/draw"/>
<ImageView
android:id="@+id/delete"
android:layout_width="80dp"
android:layout_height="50dp"
android:clickable="true"
android:layout_toRightOf="@+id/erase"
android:src="@drawable/delete"/>
<ImageView
android:id="@+id/done"
android:layout_width="80dp"
android:clickable="true"
android:layout_height="50dp"
android:layout_toRightOf="@+id/delete"
android:src="@drawable/done"/>
</LinearLayout>
<ImageView
android:id="@+id/photo"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="center"
android:layout_above="@id/buttons"/>
</RelativeLayout>
문제는 내가 단추가 그린 객체의 상단에 항상 할 것입니다 : 나는 아래의 XML로 원하는대로 내보기는 정확히 보인다. 이제 사용자가 선을 칠한 다음 한 가장자리가 이미지보다 낮게 이동하면이 선이 버튼 위에 표시됩니다. 캔버스가 내 이미지가있는 비트 맵으로 설정 되었기 때문에 그 시점에서 건드리지 않을 것입니다. 그러나 보이게됩니다. 선의 일부가 화면 밖으로 나 오면 사라지는 방식으로 사라지길 바랍니다.
어떻게 구현할 수 있습니까? 이 버튼이 페인트 된 객체 위에 항상 있는지 확인할 수있는 속성이 있습니까? 미리 감사드립니다. 당신이 @Override
onDraw
또는 onLayout
방법 한 경우