草庐IT

rel-attribute

全部标签

java - 错误 : no resource identifier for attribute 'srcCompat'

我在@drawable文件夹中使用复制+粘贴添加了2张图像,但出现错误Error:(25)Noresourceidentifierfoundforattribute'srcCompat'inpackage'com.example.francydarkcool.maps'我添加了:defaultConfig{vectorDrawables.useSupportLibrary=true;...}在build.gradle中还有:ImageViewimg1=newImageView(this);img1.setImageResource(R.drawable.cascada3);setCon

android - android :enabled attribute的双向数据绑定(bind)

我正在尝试找出Android中的双向数据绑定(bind)库。我想通过更改xml中的android:enabled属性来启用/禁用LinearLayout(以及内部的RelativeLayout)。XML部分如下所示:viewModel.doSomething()}"android:background="@drawable/shortcut_button_label_selector"android:orientation="horizontal">现在,我想这样做的原因是因为这两个选择器(shortcut_button_label_selector和shortcut_button_i

android getSharedPreferences 错误 : Map value without name attribute: boolean

我试图找出这个错误的原因,它在我尝试获取应用程序的共享首选项时发生在启动时。代码只是:settings=this.getSharedPreferences(Globals.PREFS_NAME,0)似乎是一个损坏,但该错误存在于应用程序中,因为我已将其安装在多个设备上并且发生了相同的错误。我已经卸载了应用程序并重新安装它无济于事。也做了一个完全干净的构建。我用谷歌搜索了这个错误,但似乎无法在其中找到任何内容。我之前工作正常。所以我很困惑。任何线索都将非常高度赞赏...问候,抢劫W/ApplicationContext(1541):getSharedPreferencesW/Applic

android - 覆盖安卓 :vmSafeMode attribute for debug builds

在尝试优化调试应用程序的构建和部署速度时,我发现在安装过程中执行/system/bin/dex2oat花费了大量时间。这是ARTaheadoftimecompiler.我发现当以API22为目标时,您现在可以停止ARTAOT编译:我看到部署速度有了显着提高,但我担心进行此更改可能产生的副作用。它一定会对运行时性能造成小的影响,但是启用android:vmSafeMode选项是否会产生任何其他后果?对于调试构建,是否可以在gradle构建文件中覆盖此属性?还是创建特定于调试的list文件是唯一的解决方案? 最佳答案 仅为调试构建启用a

安卓错误 :You must supply layout_width attribute

抱歉,因为我的标题与StackOverFlow上的许多其他标题相似,但这些解决方案均未解决我的问题。我正在使用RelativeLayout设计布局。在代码View中设计后,当我更改为图形View时,Eclipse通知:Youmustsupplyalayout_widthattribute.Youmustsupplyalayout_heightattribute..当我运行这个程序时,会注意到LogCat中的错误Causedby:java.lang.RuntimeException:BinaryXMLfileline#2:Youmustsupplyalayout_widthattribu

android - 获取安卓 :windowSoftInputMode attribute programmatically on Android

我知道可以使用以下方法以编程方式设置android:windowSoftInputModelist属性:getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);有没有办法以编程方式获取这个值?我没有看到相应的getter方法。 最佳答案 找到解决方案,没有“方便”的获取方法,但您可以轻松地手动查询窗口属性:intmode=getActivity().getWindow().getAttributes().soft

android - list 合并失败 : Attribute application@appComponentFactory - Androidx

当我使用androidx构建Gradle时,出现以下错误。请帮我解决这个问题。ErrorMessage:Manifestmergerfailed:Attributeapplication@appComponentFactoryvalue=(android.support.v4.app.CoreComponentFactory)from[com.android.support:support-compat:28.0.0]AndroidManifest.xml:22:18-91isalsopresentat[androidx.core:core:1.0.0]AndroidManifest.

android - 没有这样的属性 : FOR_RUNTIME for class: org. gradle.api.attributes.Usage

AndroidStudio编译错误:错误:没有这样的属性:类的FOR_RUNTIME:org.gradle.api.attributes.Usage2天内无法解决此问题。 最佳答案 请检查您的Android系统日志。通常它位于:对于Windows:C:\User\yourusername\\.AndroidStudio3.1\system\log\idea.log我遇到了同样的问题,我得到了这个错误日志:Causedby:groovy.lang.MissingPropertyException:Nosuchproperty:FOR_

android - 错误 :Attribute "color" has already been defined, 更新 appcompat v-7

我正在尝试将AndroidStudio项目中的appcompat-v7从v20.0.0更新到21.0.0以使用Material设计组件,但我总是遇到相同的错误:“错误:属性“颜色”已被定义”我不知道如何解决此错误,我在互联网上搜索但找不到答案。这是我的毕业典礼:android{compileOptions.encoding="iso-8859-1"compileSdkVersion21buildToolsVersion"21.1.1"defaultConfig{applicationId"com.test"minSdkVersion11targetSdkVersion22}buildT

android - 数据绑定(bind) : Attribute is missing the Androld namespace prefix

安卓工作室3.0classpath'com.android.tools.build:gradle:3.0.1'设置dataBinding{enabled=true}我想使用数据绑定(bind)。这是我的xml布局:但是我得到错误:AttributeismissingtheAndroidnamespaceprefix 最佳答案 您的数据绑定(bind)XML根应该是layout标记FromDocs数据绑定(bind)布局文件略有不同,以布局的根标记开头,后跟数据元素和View根元素。此View元素是您的根在非绑定(bind)布局文件中