我可以将普通视图用作小部件吗?
Can I use a plain View as a widget?
正如问题所解释的那样,我想知道我是否可以在我的小部件中使用标准视图,我知道小部件只允许某些类型的视图,即它们是:AnalogClock Button Chronometer ImageButton ImageView ProgressBar TextView ViewFlipper ListView GridView StackView AdapterViewFlipper,文档中也说了"Descendants of these classes are not supported." 但是parent呢?我可以在我的小部件布局中使用普通视图吗?不要花哨或自定义普通视图吗?像这样说
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/circle_green"
android:id="@+id/unread_count_badge"/>
不,你不能。您只能使用官方documentation
中描述的小部件
正如问题所解释的那样,我想知道我是否可以在我的小部件中使用标准视图,我知道小部件只允许某些类型的视图,即它们是:AnalogClock Button Chronometer ImageButton ImageView ProgressBar TextView ViewFlipper ListView GridView StackView AdapterViewFlipper,文档中也说了"Descendants of these classes are not supported." 但是parent呢?我可以在我的小部件布局中使用普通视图吗?不要花哨或自定义普通视图吗?像这样说
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/circle_green"
android:id="@+id/unread_count_badge"/>
不,你不能。您只能使用官方documentation
中描述的小部件