0

我试图在我的应用程序中使用Place Picker图书馆,但似乎我遇到的地方选取器屏幕的风格的麻烦。有人能告诉我如何设计这个屏幕,它是否可以调整风格?以下是我得到我的设备上:Android的地方选择器风格actionbar

enter image description here

,这里是我的AppTheme,我使用:

<!-- Base application theme. --> 
    <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"> 
     <!-- Customize your theme here. TODO --> 
     <item name="colorPrimary">@color/colorPrimary</item> 
     <item name="colorPrimaryDark">@color/colorPrimaryDark</item> 
     <item name="colorAccent">@color/colorPrimaryDark</item> 


     <!--style for switchCompat--> 
     <item name="colorControlActivated">@color/white</item> 
     <item name="colorSwitchThumbNormal">@color/white</item> 
     <item name="android:colorForeground">@color/white</item> 

     <!--<item name="actionBarStyle">@style/Widget.AppTheme.ActionBar</item>--> 
     <item name="buttonStyle">@style/My.Button</item> 
    </style> 

编辑:这只是发生我注2设备上Android 4.4,有没有人知道这个问题的解决方法?

回答

0

的Android版本低于5.0使用PlaceAutocomplete.MODE_OVERLAY

private void launchLocationAutoComplete() { 
     try { 
      Intent intent = new PlaceAutocomplete.IntentBuilder(PlaceAutocomplete.MODE_OVERLAY).build(this); 
      startActivityForResult(intent, PLACE_AUTOCOMPLETE_REQUEST_CODE); 
     } catch (GooglePlayServicesRepairableException e) { 
      Log.e(TAG, "GooglePlayServicesRepairableException", e); 
     } catch (GooglePlayServicesNotAvailableException e) { 
      Log.e(TAG, "GooglePlayServicesNotAvailableException", e); 
     } 
    } 
-1
<android.support.v7.widget.Toolbar 
     android:id="@+id/toolbar" 
     android:layout_width="match_parent" 
     android:minHeight="?attr/actionBarSize" 
     android:layout_height="wrap_content" 
     android:background="?attr/colorPrimary" 
     app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" 
     app:popupTheme="@style/AppTheme.PopupOverlay" /> 

使用类似于这种风格和背景,因为您使用无作用栏进行活动。检查颜色主要和使用黑色比白色更多。您在工具栏中使用哪一种风格的代码也可能是这样的代码:

<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" /> 

    <style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" /> 
+0

PlacePicker是重定向出旅游应用程序的意图。所以你不能手动处理风格。从请求应用程序(您的)自动应用 – IgniteCoders