Android Google Maps按钮样式 [英] Android google maps button style
问题描述
我想在Google地图上方放置一个按钮,这非常简单。但是我希望它看起来像google使用的按钮(缩放按钮,找到我的按钮)。有什么办法可以让我作弊并找到他们用于按钮的样式。还是以前有人创建过这种样式?
I would like to place a button on top of my google map, which is pretty easy. However I would like it to look like the buttons google uses (zoom buttons, locate me button). Is there a way I can 'cheat' and find the styles they used for their buttons. Or has anyone else created this style before?
推荐答案
如果使用 apktool ,然后查看 drawable
*文件夹,您将找到这些资源
If you disassemble Google Play Services apk by using apktool, and look into drawable
* folders, you will find the resources for these buttons among other resources.
例如,这是上方缩放按钮的可绘制对象:
res / drawable / maps_btn_zoom_up.xml
,这是空按钮: res / drawable / maps_btn_standalone.xml
。看着它们,匹配它们的样式要容易得多。
For example, this is the drawable of the upper zoom button:
res/drawable/maps_btn_zoom_up.xml
, and this is the "empty" button: res/drawable/maps_btn_standalone.xml
. Looking at them, it is a lot easier to match their style.
该apk可能会被命名为 com.google.android.gms-#。apk
,其中#
是一些数字;您可以使用 adb pull
命令从安装了Google Play服务的设备上抢走它,即使您知道确切的文件名,它甚至不需要植根。
The apk will probably be named like com.google.android.gms-#.apk
, where #
is some number; you can snatch it from a device which has Google Play Services installed by using adb pull
command, it doesn't even require rooting if you know the exact file name.
此处
(sha256: 4b974a8c23bb8df54b9aa244489e8a7ab5d4d3e17d0c003f411bccbe8a75d622
)
和一些数字:
按钮的高度和宽度为 38dp
阴影填充:顶部 1.5dp
底部 2.5dp
边 2dp
背景图片不是九色补丁,但是如果需要,可以很容易地创建一个。
The background image is NOT nine-patch, but it's pretty easy to create one if you need.
这篇关于Android Google Maps按钮样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!