谷歌地图类似的搜索框显示在触摸

时间:2018-10-10 15:06:16

标签: android google-maps touch show-hide

我仅在用户触摸地图时才尝试显示搜索框。谷歌地图应用上的类似内容。我尝试实现“ onClick”,但没有收到任何点击。

以下是布局文件。

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout  xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#FFFFFF"
    android:id="@+id/newLayout"
    tools:context=".FullscreenActivity"
    android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"
    android:weightSum="1.0"
    android:orientation="vertical">


        <FrameLayout
            android:id="@+id/newFlLayer"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:clickable="true"
            android:onClick="onClick"
            >
            <fragment
                android:id="@+id/map"
                android:name="com.google.android.gms.maps.SupportMapFragment"
                android:layout_width="fill_parent"
                android:onClick="onClick"
                android:layout_height="wrap_content"
                android:layout_alignParentTop="true"
                />
        </FrameLayout>

    <EditText
        android:id="@+id/editText"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:ems="10"
        android:inputType="textPersonName"
        android:text="Name" />

</LinearLayout>

0 个答案:

没有答案