草庐IT

declared_attr

全部标签

android - 有人能给我解释一下这个例子中的 declare-styleable XML 标签及其使用背后的理论吗?

我正在阅读BeginningAndroid4Development,在第5章中讨论了Gallery和ImageVievs并介绍了declare-styleableXML标记没有解释它的目的..我也试图在引用资料中找到一些信息,但没有运气..例如我们有以下内容:res/values/attrs.xmlexample.javapublicclassGalleryActivityextendsActivity{[...]publicvoidonCreate(BundlesavedInstanceState){super.onCreate(savedInstanceState);setCont

android - android :attr/textAppearanceMedium and ? android :textAppearanceMedium? 有什么区别?

我发现一些演示代码中有两种情况,?android:attr/textAppearanceMedium和?android:textAppearanceMedium有什么区别?谢谢!案例一?android:attr/textAppearanceMedium案例二?android:textAppearanceMedium 最佳答案 根据AndroidDeveloperAPIGuide-AccessingResources-Referencingstyleattributes,如果系统资源工具可以找出正确的资源类型,则资源类型是可选的。所以

android - 添加没有敏感权限的新版本时出现"release declaring sensitive permissions"错误

我在Play商店中将apk添加到alpha和beta时遇到此错误。生产正常。我找到了这个答案。Googleplayconsolesaid"Youcan'teditthisappuntilyoucreateanewappreleasedeclaringsensitivepermissions"howtofixit?WarningsYourApkIsUsingPermissionsThatRequireAPrivacyPolicy:(android.permission.READ_PHONE_STATE)我既没有使用read_phone_state权限也没有使用短信、通话记录权限我在下面附

android - 我如何找到什么?android :attr/listChoiceIndicatorSingle points to?

我有android:button="?android:attr/listChoiceIndicatorSingle"在CheckBox的布局上。我按F3带我去定义,它只是说在android-sdk/platforms/android-17/data/res/values/attrs.xml中。我搜索了整个文件,这是唯一的一次。如何找到它引用的可绘制对象? 最佳答案 属性的值在theme.xml中定义。检查SDK中的“theme.xml”。在我的例子中,它定义如下:@android:drawable/btn_radio_holo_da

c# - Xamarin 构建错误 : error APT0000: In <declare-styleable> . ..,无法找到属性

我收到了另一个开发者的项目。我设置我的机器。已配置具有所需组件的VS-2017。AndroidSDK-Manager安装了对应的版本。项目配置为使用Android7.1(Nougat)编译.开始构建我得到一个错误1>ERROR:errorAPT0000:InAppBarLayout,unabletofindattributeandroid:keyboardNavigationCluster我不清楚,我是否需要设置此信息,或者是否需要此信息。我收到了ERROR:InMenuView,unabletofindattributeandroid:preserveIconSpacing和Erro

android - gradle 构建 Javadoc 任务失败并显示 'unknown tag: attr'

我正在尝试构建android-autofittextview使用gradle从命令行进行项目。但是,它每次都失败并出现以下错误:/Users/me/android-autofittextview/library/src/main/java/me/grantland/widget/AutofitHelper.java:384:error:unknowntag:attr*@attrrefandroid.R.styleable#TextView_textSize这个错误在各种文件中重复了十几次。这发生在:library:androidJavadocs我尝试使用thisapproach将其关闭

android - AdMob 错误 "you must have adactivity declared in androidmanifest.xml with configchanges"

我正在尝试在我的Android应用程序中安装AdMob。当我启动模拟器时,它说:“您必须在androidmanifest.xml中使用configchanges声明adactivity”有很多关于这个的话题,但没有人解决这个问题。请帮帮我!问候,贾斯珀.... 最佳答案 AndroidManifest定义中的适当AdmobActivity如下所示:您可能缺少android:configChanges部分。请注意,所有configChanges参数都是必需的。由于并非所有这些都存在/在旧版SDKS中被允许,因此您需要使用更新的Andr

android - 找不到与给定名称 attr "colorPrimary"匹配的资源

我很难在XamarinStudio中编译我的Android应用程序。出现的错误如下:Noresourcefoundthatmatchesthegivennameattr"colorPrimary"它指的是我的styles.xml:@color/colorPrimary@color/colorPrimaryDark@color/colorAccent在网上找到的通常建议是将SDK版本设置为21或更高版本。但我已经尝试过了:在list中将minSdkVersion设置为21在list中将targetSdkVersion设置为21在项目设置中将目标框架设置为Android5.0清理并重建项目

android - 未找到样式属性 attr/colorSecondary

我无法构建我的项目。它显示attr/colorSecondarynotfound错误。这些是我的样式和list文件:Androidstudioversion:3.0canary9compileSdkVersion25buildToolsVersion'25.0.3'minSdkVersion17风格@color/primaryColor@color/secondaryColor颜色#fcc425#e5af17list依赖性compile'com.android.support:appcompat-v7:25.3.1'错误信息C:\Users\Raja.gradle\caches\tra

android - ?安卓 :attr/selectableItemBackground not visible enough on a dark background

在AndroidLollipop上,我使用:android:background="?android:attr/selectableItemBackground"当我点击一个按钮时获得Material动画反馈。当我在白色/浅色布局中包含一个按钮(例如CardView)时,效果很好。但是当我想在深色背景上使用同样的东西时,我们几乎看不到效果,它不够明显。有人有想法吗?谢谢 最佳答案 在API21+上,您可以设置android:theme="@android:style/ThemeOverlay.Material.Dark"在View上