popupBackground毛刺与材料设计 [英] popupBackground glitches with Material Design

查看:214
本文介绍了popupBackground毛刺与材料设计的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在更新我的应用程序,以材料设计。

我有一个使用标签的应用程序。对于每当我用安卓某些原因:popupBackground设置下拉菜单的颜色是怪胎

我设置了​​选项卡的默认项目,并使用了以下主题,同样的事情发生了。有没有人其他人有这个问题?我的应用程序是开源的,所以所有的code是可以在这里 GitHub上

 < XML版本=1.0编码=UTF-8&GT?;
<资源>
    <样式名称=AppTheme父=Theme.AppCompat.Light.DarkActionBar>
        <项目名称=actionDropDownStyle> @风格/下拉< /项目>
    < /风格>
    <样式名称=下拉父=Widget.AppCompat.Light.Spinner.DropDown.ActionBar>
        <项目名称=机器人:popupBackground>#000< /项目>
        <项目名称=机器人:以下属性来> 32dp< /项目>
        <项目名称=机器人:paddingRight> 32dp< /项目>
    < /风格>
< /资源>
 

解决方案

我已经面临着微调类似的问题。由于@alanv提到,在使用的形状,背景,而非彩色会解决这个问题。

 < XML版本=1.0编码=UTF-8&GT?;
<形状的xmlns:机器人=htt​​p://schemas.android.com/apk/res/android
机器人:形状=矩形>
<边角机器人:半径=2DP/>
[固体机器人:颜色=#000000/>
< /形状>
 

更新这是解决在最新的AppCompat。

I have been working on updating my apps to Material Design.

I have an app that uses tabs. For some reason whenever I use android:popupBackground to set the drop down menu color it freaks out.

I set up a default project with tabs and used the following theme and the same thing happened. Has anyone one else had this problem? My app is open source and so all the code is available here GitHub

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
        <item name="actionDropDownStyle">@style/Dropdown</item>
    </style>
    <style name="Dropdown" parent="Widget.AppCompat.Light.Spinner.DropDown.ActionBar">
        <item name="android:popupBackground">#000</item>
        <item name="android:paddingLeft">32dp</item>
        <item name="android:paddingRight">32dp</item>
    </style>
</resources>

解决方案

I had faced a similar issue with spinner. As @alanv mentioned use shape as background instead of colour will solve the problem.

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="2dp" />
<solid android:color="#000000" />
</shape>

UPDATE It is resolved in latest AppCompat.

这篇关于popupBackground毛刺与材料设计的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆