草庐IT

android - Gingerbread 设备不使用 Theme.AppCompat(支持库)中的 Holo 样式

我正在使用v4和v7支持库将操作栏和抽屉导航集成到我的应用中,它支持API10+。我已按照developersite上的指南进行操作分别使用Theme.AppCompat和style/Widget.AppCompat.ActionBar作为我的主题和操作栏样式的父项。一切正常,除了当我在Gingerbread设备上测试时,下拉菜单/弹出菜单之类的东西有白色背景(来自手机的皮肤)并且文本字段不使用全息式背景(再次使用手机皮肤)。为了让全息之前的设备继承全息风格的小部件,我还需要做些什么吗?提前致谢。 最佳答案 无论使用支持库,Text

android - Logcat 说 : "Resource has unresolved theme attributes"

记录我的应用程序时,我的Logcat说:警告:...具有未解析的主题属性!考虑使用Resources.getDrawable(int,Theme)或Context.getDrawable(int)。产生警告的代码:if(mCards.get(position).isFavorite()){viewHolder.mIbStar.setImageDrawable(mContext.getResources().getDrawable(R.drawable.btn_is_fav));}else{viewHolder.mIbStar.setImageDrawable(mContext.getR

android - 样式,最小高度/最大高度 : I cannot get the maxHeight to override the theme minHeight

我认为更多的“全局”样式总是被更多“本地”样式覆盖。例如,如果我将所有按钮重新定义为具有textSize=40dip(将该样式应用为应用程序的主题),然后将另一个样式应用到一个特定的按钮,即textSize=10dip,那么该特定的按钮应该获得10diptextSize。通常这就是它的工作原理。但是当涉及到maxHeight时就不是这样了。这是场景:在我的styles.xml中,我有一个Style,我继承了默认的Button并更改了textSize和minHeight,然后另一个Style设置了一些其他值(但也继承自Button),就像这样:26dip60dip18dip70dip10

安卓 map :Failed to find style 'mapViewStyle' in current theme

我正在尝试在我的应用程序中使用map,但出现此错误,在当前主题中找不到样式“mapViewStyle”我已正确生成key,并已尝试在其他地方为同一问题提供的所有解决方案。1.mytargetapiandtheonementionedinthemanifestfilearethesame.2.Thereisnoimport.Rinmyproject3.Ihavecleanedmyproject.4.Uses-libraryelementisachildoftheapplication.这是我的xml文件这是我对应的java文件包com.epidemicator.prototype;imp

android - 更改操作栏标题颜色 Theme.AppCompat.Light.DarkActionBar android

我想在android中将操作栏标题颜色更改为白色。我在值Theme.AppCompat.Light和values-14Theme.AppCompat.Light.DarkActionBar中使用主题到目前为止我已经尝试过在值文件夹中:@style/MyActionBar@android:color/white和值-14文件夹@style/MyActionBar@android:color/white但ActionBar标题颜色没有改变。 最佳答案 您可以使用colorPrimary属性指定ActionBar的背景颜色;类似于以下内容

Android:如何为不同的android版本使用不同的主题?

MinSDKVersion=7TargetSDKVersion=17如果用户有SDKVersion11或更高版本,我喜欢将主题设置为Theme.Holo.Light。它在这里对我不起作用。当我在3.1设备上启动应用程序时,它只使用Theme.Light:当我在低于3.1版本的设备上运行这个应用程序时也是如此我的文件夹结构:list:值-v11:其他值文件夹:如何正确使用它?真诚的马尔科塞兹 最佳答案 为什么您的主题在styles.xml文件中有两次?删除你不需要的(在本例中是Theme.Light主题):值-v11:值(value)

android - 如何在默认主题 Theme.Holo.Light 中更改 homeAsUpIndicator 的图像

在我的安卓应用中,我使用的是默认主题Theme.Holo.Light。现在我想更改默认使用的“@android:drawable/ic_ab_back_holo_light通过将其更改为@drawable/ic_launcher但这里的标志保持原样,它不会改变图像。我附上了actionBar的屏幕截图。任何帮助将不胜感激。 最佳答案 将它们放入您的默认Activity主题中。@drawable/ic_launcher 关于android-如何在默认主题Theme.Holo.Light中更

java - 检索项目 : No resource found that matches the given name '@android:style/Theme.AppCompat.Light.DarkActionBar' 的父项时出错

我正在关注来自developers.android.com的android开发教程,目前我正在尝试使用此处提供的信息来设置操作栏的样式:https://developer.android.com/training/basics/actionbar/styling.html#CustomBackground7这是res/values/themes.xml的代码:@style/MyActionBar@style/MyActionBar@drawable/actionbar_background@drawable/actionbar_background我在“style”开始标签旁边看到红叉

android - 错误 : IllegalArgumentException: The style on this component requires your app theme to be Theme. Material 组件

下面是我的依赖implementation'com.google.android.material:material:1.0.0'implementation'androidx.appcompat:appcompat:1.0.2'implementation'androidx.constraintlayout:constraintlayout:1.1.3'我的layout.xml上面的代码对我来说工作正常但是当我更新materialdesign的dependenciesimplementation'com.google.android.material:material:1.1.0-a

android:theme ="@android:style/Theme.NoTitleBar.Fullscreen"安卓不工作

我在list文件中声明我的Activity,如下所示。我声明了全屏主题的Activity。但它不起作用。我也使用第二种全屏方式,如下所示。requestWindowFeature(Window.FEATURE_NO_TITLE);getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);但是没有成功。请帮我找到这个。 最佳答案 我通过在应用程序级别声明全屏主题来解决它。