0

私は次のレイアウトを持っています:

<?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" >

<com.myapp.imagezoom.ImageViewTouch
    android:id="@+id/image"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" />

<TextView
    android:id="@+id/txtTitle"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_gravity="bottom|center"
    android:layout_marginBottom="3dp"
    android:gravity="center"
    android:maxLines="2"/>

<ProgressBar
    android:id="@+id/loading"
    style="?android:attr/progressBarStyleLarge"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="center"
    android:visibility="gone" />

ご覧のとおり、ズーム可能な ImageView があります。TextView は、ズームされていない限り、ImageView の下に表示されます。ユーザーが ImageView にズームインすると、その上に表示されます。表示されている ImageView が TextView と重なって TextView の背景を表示しているかどうかを検出するにはどうすればよいですか?

どうもありがとう

4

1 に答える 1

0

ImageViewTouch呼び出されたプロパティをクラスに追加し、isZoomedそれが true か false かをカスタム オーバーライド メソッドまたはAsyncTaskに検証し、TextView の背景または必要なものを設定する必要があります。

カスタム オーバーライド メソッドの作成の詳細については、このをお読みになることをお勧めします。簡単にその方法を説明しています。

于 2012-12-03T19:18:56.137 に答える