Я пишу приложение для Android и у меня проблемы с перекрывающимися представлениями.Мой макет
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView
...
/>
<EditText
...
/>
<Button
...
/>
<Button
...
/>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<SurfaceView
android:id="@+id/surface_view"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
<CustomView
android:id="@+id/custom_view"
android:background="#0000"
android:layout_alignTop="@id/surface_view"
android:layout_alignBottom="@id/surface_view"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
</RelativeLayout>
</LinearLayout>
Как вы можете видеть, я пытаюсь перекрывать поверхности_обзоров и настраиваемых_просмотров.Только custom_view отображается на экране.Если я сначала определяю custom_view, а затем surface_view, то отображается только surface_view, но вызываются методы custom_view, поскольку я мог видеть сообщения журнала в adb logcat.Я что-то упускаю.
Тот же макет (перекрытие), что и выше, отлично работает в другом проекте.
Любые мысли будут полезны.Благодарю.