Android Home Screen Widget (icon, label - style)

后端 未结 2 465
隐瞒了意图╮
隐瞒了意图╮ 2020-11-29 12:33

I\'m trying to create an icon/widget (1 cell x 1 cell) that can be placed on the home screen of android. The widget will look and act exactly like the other standard shortcu

2条回答
  •  春和景丽
    2020-11-29 13:11

    To make your item consistent with the system look and feel is not hard by referencing the system attribute android:attr/selectableItemBackground. For example, if you want to make an ImageView in your widget look "selectable" with proper highlighting etc: just do

    
    

    There are a lot in android_sdk_path/platforms/android-x. Happy digging!

    EDIT: I found out later that this simple attribute does not live in SDK < v11. So the best way I know now is to download the appwidget template pack and use it.

提交回复
热议问题