【问题标题】:How to add Buttons and textView inside the fragment of android libraries places widget如何在android库的片段中添加按钮和textView
【发布时间】:2020-08-07 16:20:14
【问题描述】:

我正在尝试实现如下图所示我如何在片段 android.libraries.places.widget 中做我尝试使用相对布局但它没有显示在位置小部件中任何人都可以建议一些好的资源来做到这一点或者是还有其他可以用来做的布局。

我尝试过的 Xml:

  <?xml version="1.0" encoding="utf-8"?>
<FrameLayout 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"
tools:context=".Maps.MapsAddress" >


<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:layout_marginTop="10dp"
android:id="@+id/autocomplete_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:name="com.google.android.libraries.places.
widget.AutocompleteSup   portFragment"/>

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Chetpet Chennai"
android:textSize="14sp"
android:id="@+id/toolbar_address">
</TextView>

</FrameLayout>

【问题讨论】:

    标签: android google-maps android-layout android-fragments


    【解决方案1】:

    根布局使用:相对

    SearchBar 布局可以使用 searchview 或浮动 searchview(外部库)

    设备位置可以使用相对布局,因此图标放置在父级等的开头

    保存的地址,您可以使用表格布局。

    将 id 分配给不同的布局,以便您可以将布局堆叠在根相对布局内

    ​​>

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-10-19
      相关资源
      最近更新 更多