【发布时间】:2016-01-17 11:02:16
【问题描述】:
我想将 getlocation / compass 按钮放在我的编辑字段中,我不太确定如何执行此操作或从哪里开始,请有人指导我。我要做的是,类似于下面的两个屏幕截图;
我尝试过使用布局,但我似乎无法弄清楚如何做到这一点,我已经完成了基本布局;
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:background="?attr/colorPrimary"
android:orientation="vertical" >
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="100dp">
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textPostalAddress"
android:ems="10"
android:hint="Your Post Code"
android:id="@+id/editText"
android:layout_gravity="center_horizontal"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"/>
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Proceed"
android:background="#fff"
android:id="@+id/button"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp" />
</LinearLayout>
</LinearLayout>
【问题讨论】:
标签: android google-maps android-layout location postal-code