在Android中实现Google地图上的其他布局和视图

在Android中实现Google地图上的其他布局和视图,android,google-maps,android-layout,Android,Google Maps,Android Layout,我正在尝试创建一个像这样的屏幕。这是我的设计目标 我正在使用RelativeLayout以及MapFragment。但这看起来不像下面的屏幕。我很感激你的建议,以正确的方式做这件事。这是我的密码 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" &g

我正在尝试创建一个像这样的屏幕。这是我的设计目标

我正在使用
RelativeLayout
以及
MapFragment
。但这看起来不像下面的屏幕。我很感激你的建议,以正确的方式做这件事。这是我的密码

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >

<fragment xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:map="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/map"
    android:name="com.google.android.gms.maps.SupportMapFragment"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="gps.finder.com.findermaterial.MapsActivity" />


        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="200dip"
            android:layout_alignParentBottom="true"
            android:layout_alignParentLeft="true"
            android:layout_alignParentStart="true"
            android:background="#c8e6c9">

            <TextView
                android:id="@+id/details"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:maxLines="3"
                android:padding="8dp"
                android:text="Card View"
                android:textColor="#222"
                android:textStyle="bold"
                android:textSize="22dp" />

            <TextView
                android:id="@+id/title"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_below="@+id/details"
                android:maxLines="3"
                android:padding="8dp"
                android:text="Card View"
                android:textColor="#222"
                android:textStyle="bold"
                android:textSize="22dp" />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_below="@+id/title"
                android:maxLines="3"
                android:padding="8dp"
                android:text="description"
                android:textColor="#666"
                android:textSize="14dp" />

        </RelativeLayout>

</RelativeLayout>


有人能告诉我怎么做吗?

如果您在这些视图上使用OnTouchListener,请在最后返回true。

如果您在这些视图上使用OnTouchListener,请在最后返回true。

只需使您的
文本视图可单击添加即可

android:clickable="true
例如:

<TextView
    android:id="@+id/details"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:maxLines="3"
    android:padding="8dp"
    android:text="Card View"
    android:textColor="#222"
    android:textStyle="bold"
    android:textSize="22dp"
    android:clickable="true" />

只需使您的
文本视图
s可点击添加即可

android:clickable="true
例如:

<TextView
    android:id="@+id/details"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:maxLines="3"
    android:padding="8dp"
    android:text="Card View"
    android:textColor="#222"
    android:textStyle="bold"
    android:textSize="22dp"
    android:clickable="true" />

  • 给你的内在亲戚一个身份证
  • 将clicklistener设置为布局
示例

(在xml代码中)

这会解决你的问题

如果这是您想要的,请告诉我。

  • 给你的内在亲戚一个身份证
  • 将clicklistener设置为布局
示例

(在xml代码中)

这会解决你的问题


如果这是您想要的,请告诉我。

在此处发布您的xml代码。你现在做了什么?@SagarNayak我添加了我的xml代码。请检查它,或者你可以建议我任何有用的链接。这是必要的,使您的地图填写整个屏幕。因为即使它填满了你的屏幕,你也看不到它。因此,我建议您将地图限制在真正可见的范围内。你现在做了什么?@SagarNayak我添加了我的xml代码。请检查它,或者你可以建议我任何有用的链接。这是必要的,使您的地图填写整个屏幕。因为即使它填满了你的屏幕,你也看不到它。所以我建议你将地图限制在真正可见的范围内。你好-谢谢你的回复。我也需要设计指南。我上传了一个示例图像,这就是我的目标设计。你能告诉我怎么做吗?首先在你的代码中实现这个答案,让我知道它是否有效。然后我们可以继续。您好-谢谢您的回复。我也需要设计指南。我上传了一个示例图像,这就是我的目标设计。你能告诉我怎么做吗?首先在你的代码中实现这个答案,让我知道它是否有效。然后我们可以继续。