【发布时间】:2015-11-29 19:47:44
【问题描述】:
我正在尝试将 ImageButton 覆盖在 GoogleMap 的片段之上。我也尝试使用following StackOverflow post 作为参考,但没有运气。为了做到这一点,这是我的 xml:
<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=".MapActivity" >
<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_height="fill_parent"
android:layout_width="fill_parent"
tools:context="com.example.beckah.myapplication.Citisplore"/>
<ImageButton
android:id="@+id/imageButton1"
android:background="@drawable/transit_icon"
android:layout_width="55dp"
android:layout_height="55dp"
android:scaleType="fitCenter"
android:layout_gravity="right|bottom" />
</FrameLayout>
我也很确定硬编码图像的高度/宽度并不是最佳做法。
如何更精确地定位 ImageButton?
【问题讨论】:
-
看起来您需要在 ImageButton 周围留出边距
标签: android xml user-interface