开发者

Android CheckedTextView - Set checkMark dynamically

开发者 https://www.devze.com 2022-12-16 14:53 出处:网络
Given this XML property of the CheckedTextView\'s checkMark: android:checkMark=\"?android:attr/listChoiceIndicatorMultiple\"

Given this XML property of the CheckedTextView's checkMark:

android:checkMark="?android:attr/listChoiceIndicatorMultiple"

How开发者_运维技巧 can you set the checkMark property dynamically (i.e. from code)? Does Android have any documentation on this?

Using: Android 1.5

Note: I am building a regular jar library that does not have any access to android XML resource files or drawables so everything has to be created programatically.


From the API doc of CheckedTextView, it sounds like the two setCheckMarkDrawable methods would do the job?

You just need to pass in a StateListDrawable.

0

精彩评论

暂无评论...
验证码 换一张
取 消