0

ギャラリーをいじっているときに、別の質問があります (これはおそらくもっと簡単なはずです)。

ギャラリーの前にあるビューを表示しようとしていますが、おそらくそれを部分的に隠しています。メッセージ ダイアログ (トースト) のように。

そのために、背面に Gallery を持つ FrameLayout を使用し、前面に透明な src を持つ ImageView を使用しています。ダイアログを表示する必要がある場合は、「sendImage」を介して必要なドローアブルに src を設定しています。

私が推測するように、問題は、ギャラリー/リスト項目 (「onRequestListItem -> sendListItem」で動的に追加される) がより最近の z-Order (後で追加されたため) を持っているため、背景の間にダイアログが表示されることです。ギャラリーと、リスト項目を表す透明なアイコンの。

多分誰かがこの状況を回避する方法を考えているでしょうか?

SmartWatch のレイアウトにビューを手動で追加する方法や、「bringToFront」を使用して zOrder を変更する方法を知りません。

ソースコードは次のとおりです。

ギャラリー.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" >

    <Gallery
        android:id="@+id/gallery"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

    <ImageView
    android:id="@+id/toast"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:src="@drawable/toast_dialog_message" />

</FrameLayout>

gallery_item.xml

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <ImageView
    android:id="@+id/item_icon"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_centerHorizontal="true"
    android:layout_marginTop="20px"
    android:src="@drawable/item_icon" />

</RelativeLayout>

GalleryControlExtension.java

sendImage(R.id.spritz_image, drawableResourceId);

PSエミュレータでは期待どおりに動作します:toastはitem_iconの上にあります...

4

0 に答える 0