【发布时间】:2010-10-29 07:03:24
【问题描述】:
我有一个 FrameLayout 视图,其中包含一个(类似 MapView)控件和一些覆盖它的附加按钮。 (布局xml如下)。
我想让用户不仅可以使用触摸而且还可以使用轨迹球来平移/滚动主视图。 问题是 - 使用轨迹球只是在布局上的所有控件之间切换焦点,我似乎找不到将 onTrackballEvent 包含到 MainView 的方法。
欢迎任何建议,在此先感谢。
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="fill_parent">
<FrameLayout android:id="@+id/pageView"
xmlns:panel="http://schemas.android.com/apk/res/com.yappa"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<MainView
android:id="@+id/mainView"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
</MainView>
<ZoomControls android:id="@+id/ZoomControls01"
android:layout_gravity="bottom|center"
android:layout_height="wrap_content" android:layout_width="wrap_content">
</ZoomControls>
<Panel
....
</Panel>
</FrameLayout>
</merge>
【问题讨论】:
-
您尝试过使用
android:focusable属性吗? -
focusable 控制您如何从一个控件转到另一个控件。不是我在问题中的意思
标签: android view custom-controls trackball