Offsetting position of a View in a AppWidget
I am creating an AppWidget that allows users to skin the widget and download from a list of widgets online. I would like to allow skinners to offset the position of开发者_高级运维 the icons vertically.
I initally tried calling offsetTopAndBottom on the LinearLayout that holds the icons, this is not allowed as its not supported with RemoteViews.
I then had an idea of using 2 Views inside a LinearLayout (on top and below the icon Layout) to "squash" the icons towards the bottom (if the height of the top layout was set to > 0).
When I tried to set the height of these views: -
views.setInt(R.id.iconMarginTop, "setMinimumHeight", offset);
it also complained that it wasn't supported with RemoteViews
Any ideas what I could do to acheive this offset?
Thanks for your help!
I don't think this can be done. The best thing I can think of is to have multiple layouts with the view at different positions. This might not suit every situations though
精彩评论