草庐IT

style-attribute

全部标签

AttributeError: partially initialized module ‘torch‘ has no attribute ‘no_grad‘ (most likely due to

(py38)root@autodl-container-f87d1190ac-c4b4f816:~/autodl-tmp/work1.1#pythonPython3.8.16(default,Mar22023,03:21:46)[GCC11.2.0]::Anaconda,Inc.onlinuxType"help","copyright","credits"or"license"formoreinformation.>>>importtorchTraceback(mostrecentcalllast):File"/root/miniconda3/envs/py38/lib/python3.8/s

android - "Your content must have a ListView whose id attribute is ' android.R.id.list '"当从ListActivity变为 View 时

我想编写一个应用程序:a:用sdcard中的图片文件填充ListView,b:从列表中选择一个选项时显示图像。但是,它挂起并出现上述异常。我不明白为什么...?请帮忙!主要Activity:publicclassProjektJimmuActivityextendsListActivity{@OverridepublicvoidonCreate(BundlesavedInstanceState){super.onCreate(savedInstanceState);navigateTo("/sdcard/");}publicvoidnavigateTo(Stringdir){setLi

android - android-support-v7-mediarouter 中的 styles.xml 错误

以下是android-support-v7-mediarouter的styles.xml文件。56dp48dp0dptrue@string/mr_media_route_button_content_description@drawable/mr_ic_media_route_holo_dark56dp48dp0dptrue@string/mr_media_route_button_content_description@drawable/mr_ic_media_route_holo_light但是我收到很多没有找到资源的错误,其中一些是:[2014-04-0510:03:14-Spl

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);但是没有成功。请帮我找到这个。 最佳答案 我通过在应用程序级别声明全屏主题来解决它。

xml - 访问安卓 :installLocation manifest attribute

我正在尝试编写一个Android2.2应用程序,它将找到可以移动到SD卡的已安装应用程序。执行此操作的权限编码在AndroidManifest.xml中文件作为根级属性“android:installLocation”。PackageInfo似乎对除此属性之外的所有内容都有接口(interface)。我可以打开已安装的apk并提取AndroidManifest.xml文件,但它似乎是某种二进制编码格式,一些随机的互联网用户为此编写了解码器,但这似乎是一项非常多的工作。是否有我缺少的界面? 最佳答案 事实证明,虽然没有直接的API调用

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

这是我的res/values/themes.xml中的代码。我的minSdkVersion设置为11。M收到错误,因为检索项目的父项时出错:找不到与给定名称@style/Theme.Holo匹配的资源。@style/MyActionBar@style/MyActionBarTabText@color/actionbar_text@style/MyActionBarTitleText@color/actionbar_text@color/actionbar_text 最佳答案 改变到对其他样式资源也做同样的事情......

android - "Too many attribute references"警告

我有一个应用程序,其中一些fragment仅由ListView组成。我的一些使用低端设备的用户遇到了一个现象,其中一个fragment根本无法显示数据。当他们进入fragment时,我显示一个ProgressBar,这个ProgressBar似乎永远旋转。所以我买了一台低端设备,但也遇到了同样的问题。我通过对后端API的网络请求获取ListView的数据,但从未返回答案。到目前为止我看到的唯一警告是W/ResourceType﹕Toomanyattributereferences,stoppedat:0x01010034我在网上找不到太多关于这个错误的信息,但似乎这个警告记录在这里ht

解决运行 AttributeError: ‘str‘ object has no attribute ‘read‘ and ‘str‘ object has no attribute ‘seek‘

跑代码的时候遇到了这种问题,如下图或者代码段中展示AttributeError:'str'objecthasnoattribute'seek'data=[self.dataset[idx]foridxinpossibly_batched_index]File"/home/amax/wj/MA-GAN-main/dataset.py",line54,in__getitem__input_image=load_img(self.image_filenames[index])File"/home/amax/wj/MA-GAN-main/dataset.py",line40,inload_imgimg