- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我正在使用 Google Play 服务中的 PlacePicker 库来启动新 Activity 。新的 Activity/选择器有一个默认没有样式的工具栏(actionbar)。
PlacePicker 文档指出
If you set custom colors in your application using the material theme,the place picker inherits the colorPrimary and colorPrimaryDarkattributes from the theme.
我的 style.xml 文件中有一个主题:
<style name="AppTheme" parent="Theme.AppCompat.Light">
<item name="colorPrimary">#5665bb</item>
<item name="android:colorPrimary">#5665bb</item>
<item name="colorPrimaryDark">#41456b</item>
<item name="android:colorPrimaryDark">#41456b</item>
</style>
并且我已经设置了要在我的 Android Manifesto 文件中使用的主题
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
placepicker 由以下代码创建:
try {
PlacePicker.IntentBuilder intentBuilder = new PlacePicker.IntentBuilder();
Intent intent = intentBuilder.build(Main.this);
// Start the intent by requesting a result,
// identified by a request code.
startActivityForResult(intent, REQUEST_PLACE_PICKER);
} catch (GooglePlayServicesRepairableException | GooglePlayServicesNotAvailableException e) {
Log.e("", "Error with Google Play lib.");
}
但是,工具栏没有样式。和以前一样,它具有白色背景和黑色文本。有趣的是,我自己的工具栏 (actionbar) 确实有样式。
如何强制 placepicker Activity 采用我的主题?
最佳答案
这是一个 acknowledged issue由开发团队。
There is currently a known issue with setting custom theme colors on the PlacePicker. For now you can work around this by defining two colors with the names "primary" and "primary_dark" - these will be applied to the PlacePicker.
Unfortunately setting the primary/primaryDark property on a theme will not affect the PlacePicker styling at the moment.
编辑:现在似乎已修复。
This should be fixed in Google Play Services 10.0. Place Picker and Autocomplete Widget will use the colorPrimary and colorPrimaryDark colors from your app.
关于android - PlacePicker 不选择 Material 主题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29733340/
非常烦人,我的 google place 只有在用户双击时才能工作。 为什么会这样? 我的代码,地点选择器初始化的地方 etLocationD.setOnClickListener(new View.
Android Placepicker is deprecated since last month .我如何使用"new"谷歌地图平台 (API) 获取或构建一个简单的经纬度坐标(地点)选择器? 最
我想更改下图中突出显示的标题语言 我怎样才能做到这一点? 最佳答案 就像许多其他 Google 应用程序一样,这些字符串会自动翻译成用户语言。我目前正在使用 PlacePicker 开发一个应用程序,
我在我的 Android 应用程序中使用 Google PlacePicker。我可以用它来选择地址。但是,一旦选择了地址,它就不会返回到调用者 Activity 。相反,我必须按下后退按钮! 这是我
我注意到随着 xcode 9 的更新,在呈现 Google Place Picker 时会弹出运行时警告消息: UI API called from background thread present
Places SDK 错误:Error Domain=com.google.places.ErrorDomain Code=-3 “Places SDK 库中发生内部错误。如果您认为此错误代表错误,请
我正在使用 google play-services version 9.4.0 我正在使用 PlaceAutocomplete with overlay mode .但现在它有这个奇怪的重叠问题。
我在我的应用程序中实现了 PlacePicker.IntentBuilder UI。在最长的时间内它没有问题,但现在一旦 UI 出现,它就会关闭,我不确定为什么。疯狂的事情是查看 logcat 它不会
我正在尝试开发基于 google place API 的应用程序。当我尝试使用时 Place place=PlacePicker.getPlace(data,this); 有一个错误显示 getPla
我正在开发一个 Android 应用程序,并正在研究 Google Places 以了解该应用程序中的某些功能。 Google 最近发布了我正在使用的 PlacePicker 功能。我已遵循 Goog
我正在尝试从属于我的 Android 应用程序的 fragment 中使用 google placepicker。我似乎无法使用 onActivityResult 返回的数据。我使用了 ( https
我使用地点选择器 API 获取了用户当前位置。现在我想在我的 Activity 中显示用户选择的位置。下面是我的代码: public class StoreFinder extends AppComp
我已经安装了 pod 但现在我想再添加一个 pod 'GMSPlacePickerController' ,过去我已经更改了我的项目名称所以每当我尝试安装 pod 时有时找不到 pod 文件,有时会发
很遗憾,我无法在 Android Place Picker closes immediately after launch 找到答案.对我来说,PlacePicker 启动,将位置显示为未知,然后返回
我正在使用 Google Play 服务中的 PlacePicker 库来启动新 Activity 。新的 Activity/选择器有一个默认没有样式的工具栏(actionbar)。 PlacePic
我想从 Android PlacePicker API 中删除确认对话框,这可能吗? 最佳答案 目前无法在地点选取器中禁用确认步骤。 关于Android PlacePicker API IntentB
这是我试过的代码,但是当用户没有选择任何东西而只是返回时, Activity 不会调用 onActivityResult() 方法 我将 PlacePIcker 称为 googleMap.setOnM
基于 Google API 的应用程序。当我尝试使用 Place place = PlacePicker.getPlace(this, data) 出现错误显示: cannot resolve met
在我的项目中,PlacePicker 运行良好,但今天突然在启动后立即关闭,结果代码为 2。 这是 logcat 输出 07-06 16:06:36.596 1023-20519/? W/Plac
我的应用程序使用 google maps api 和 google places api。一切正常,直到我搜索某个地方,当我搜索一个地方然后从结果中选择它时,会出现一个对话框(不应显示)并提示用户是否
我是一名优秀的程序员,十分优秀!