【发布时间】:2016-09-06 20:58:10
【问题描述】:
我在Android imageView Zoom-in and Zoom-Out 使用 ZoomableImageView(参见 Nicolas Tyler 的帖子)
我将 FrameLayout 用于重叠视图技术。我希望球(带有 id 球的 ImageView)始终与(背景)地图(带有 id 地图的 ZoomableImageView)重叠。
布局是这样的:
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<mypackage.ZoomableImageView
android:id="@+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="matrix"
android:src="@raw/gamemap"
/>
<ImageView
android:id="@+id/ball"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@raw/ball"
/>
</FrameLayout>
球“附着”(“映射到”)到游戏地图上的(可见)点(例如:PointF)。像地图应用程序一样,当我缩放背景(游戏地图)时,球需要相对于游戏地图自动移动。所以缩放时球对屏幕可见或不可见。
我想按照我说的执行。我想检查球对屏幕可见或不可见。我该怎么办?
【问题讨论】: