定制评级栏?(Custom rating bar?)
我有一个布局。我在其中嵌入了一个自定义评级栏:
<RatingBar android:id="@id/rate" style="?android:attr/ratingBarStyleSmall" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginRight="5.0dip" android:isIndicator="true" android:max="5" android:numStars="5" android:progressDrawable="@drawable/ratebar_theme" android:stepSize="0.1" />
它是
ratebar_theme
:<?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android" > <item android:id="@android:id/background" android:drawable="@drawable/star_empty_show"/> <item android:id="@android:id/secondaryProgress" android:drawable="@drawable/star_empty_show"/> <item android:id="@android:id/progress" android:drawable="@drawable/star_filled_show"/> </layer-list>
star_empty_show
和star_filled_show
都是star_filled_show
的drawable
文件夹中的.png
文件。上面的代码没有错误,但在Graphical layout
选项卡中我看到:Failed to parse file E:\...\res\drawable\ratebar_theme.xml
在
Error Log
我看到了这个:org.xmlpull.v1.XmlPullParserException: Binary XML file line #6: <item> tag requires a 'drawable' attribute or child tag defining a drawable
但我已经为每个
drawable
添加了drawable
属性。是否知道为什么会出现这个错误?I have a layout.I have embedded a custom rating bar in it:
<RatingBar android:id="@id/rate" style="?android:attr/ratingBarStyleSmall" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginRight="5.0dip" android:isIndicator="true" android:max="5" android:numStars="5" android:progressDrawable="@drawable/ratebar_theme" android:stepSize="0.1" />
It is
ratebar_theme
:<?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android" > <item android:id="@android:id/background" android:drawable="@drawable/star_empty_show"/> <item android:id="@android:id/secondaryProgress" android:drawable="@drawable/star_empty_show"/> <item android:id="@android:id/progress" android:drawable="@drawable/star_filled_show"/> </layer-list>
Both
star_empty_show
andstar_filled_show
are.png
files indrawable
folder of project.Both above codes have no error,but inGraphical layout
tab I see this:Failed to parse file E:\...\res\drawable\ratebar_theme.xml
And in
Error Log
I see this:org.xmlpull.v1.XmlPullParserException: Binary XML file line #6: <item> tag requires a 'drawable' attribute or child tag defining a drawable
But I have add
drawable
attribute to each item.Do ypu know why this error occures?
原文:https://stackoverflow.com/questions/14439523
最满意答案
如果你有easy_install,或者更好的
pip
安装,应该像下面这样简单:
easy_install/pip install virtualenv
mkdir django1.2
virtualenv django1.2
这会将python二进制文件放在
django1.2
文件夹中的bin
文件夹中。 只需使用那个python二进制文件,你就拥有了一个很好的小型自包含环境。 然后,您可以将easy_install / pip安装到该环境中,然后安装django 1.2并进行黑客攻击。If you have easy_install, or better yet
pip
installed, should be as easy as:
easy_install/pip install virtualenv
mkdir django1.2
virtualenv django1.2
This will put the python binary in a
bin
folder inside thedjango1.2
folder. Just use that python binary, and you've got a nice little self-contained environment. You can then install easy_install/pip into that environment, and then install django 1.2 as well, and hack away.
相关问答
更多-
你可能有一个不需要** kwargs的自定义Model.save()方法。 看看文档 。 You probably have a custom Model.save() method that does not take **kwargs. Have a look at the docs.
-
要检索csrf令牌本身,您需要使用一些Django的内部。 首先,将此行包含在视图的顶部。 from django.middleware.csrf import get_token 现在,在将参数传递给模板时,请执行类似的操作 def my_view(request): return render_to_response("index.html", {"csrf_token": get_token(request)}) 在您的模板中,只需使用{{ csrf_token }}引用令牌。 To re ...
-
我不确定翻译导入。 一切都可以去。 我猜你是需要翻译导入的,它应该在第一次导入webapp之后完成。 I'm not sure about the translation import. Everything else can go. I'm guessing that were you need the translation import, it should be done after first importing webapp.
-
Django 1.2和南方问题(Django 1.2 and south problem)[2024-01-24]
Django 1.2支持多个DB,而您运行的South版本则不支持。 尝试检查一个更新的版本 - 据说这是固定在0.6的某个点 ,并应该在0.7。 Django 1.2 supports multiple DB's, and the version of South you are running does not. Try checking out a more recent version - supposedly this was fixed at some point in 0.6, and sho ... -
如果你有easy_install,或者更好的pip安装,应该像下面这样简单: easy_install/pip install virtualenv mkdir django1.2 virtualenv django1.2 这会将python二进制文件放在django1.2文件夹中的bin文件夹中。 只需使用那个python二进制文件,你就拥有了一个很好的小型自包含环境。 然后,您可以将easy_install / pip安装到该环境中,然后安装django 1.2并进行黑客攻击。 If you have ...
-
当匿名用户尝试转到/ editor / 25(例如)并重定向到登录进行身份验证时,“next”始终为None,即使它存在于url中(它应该是“/ editor / 25”)。 这听起来很奇怪。 你能检查一下URL确实有?next=/editor/25/作为查询字符串? 同时记录request.GET ,看看会发生什么。 此外,您可能希望从request.GET获取next参数,并在呈现模板时将其作为(可选)隐藏输入包含在表单中。 auth模块的login视图执行此操作。 这样你的表单就可以从POST req ...
-
Django 1.2来自Google Web Toolkit的CSRF和HTTP帖子(Django 1.2 CSRF and HTTP posts from Google Web Toolkit)[2022-09-24]
如果您已经检查了auth.login的模板,您会注意到相关文章
更多- 微信5.0:可定制菜单栏、移动支付、公众账号付费订阅
- Custom SOLR Search Components - 2 Dev Tricks
- Hadoop Hive SQL语法详解
- Solr: a custom Search RequestHandler
- Hadoop0.20+ custom MultipleOutputFormat
- My W3C Custom Mapping File
- [How to] Make custom search with Nutch(v 1.0)?(转)
- 微信公众平台定制开发
- iphone上自定义状态栏效果的实现
- iphone上自定义状态栏效果的实现
最新问答
更多- 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
- 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
- OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
- 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
- codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
- 在计算机拍照在哪里进入
- 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
- No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
- 单页应用程序:页面重新加载(Single Page Application: page reload)
- 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
- System.StackOverflow错误(System.StackOverflow error)
- KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
- 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
- android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
- TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
- 企业安全培训的各项内容
- 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
- C#类名中允许哪些字符?(What characters are allowed in C# class name?)
- NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
- 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
- 将多个行和可变行移动到列(moving multiple and variable rows to columns)
- 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
- 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
- Angular $资源不会改变方法(Angular $resource doesn't change method)
- 在Angular 5中不是一个函数(is not a function in Angular 5)
- 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
- 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
- 常见的python rpc和cli接口(Common python rpc and cli interface)
- Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
- 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)