开发者

Resizable widgets while supporting Android 3.0?

开发者 https://www.devze.com 2023-03-22 21:22 出处:网络
I was wondering if it\'s possible to somehow make an application that supports Android 3.0 while also making it possible for widgets in that application to be resizable if it is run on Android 3.1+.

I was wondering if it's possible to somehow make an application that supports Android 3.0 while also making it possible for widgets in that application to be resizable if it is run on Android 3.1+.

I'm guessing it's not the case, but I thought I'd check he开发者_StackOverflowre first. Thanks!


With Android 3.1 this is now possible Add the following to your appwidget-provide element android:resizeMode="horizontal|vertical"

Example from google

<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
android:minWidth="294dp"
android:minHeight="72dp"
android:updatePeriodMillis="86400000"
android:previewImage="@drawable/preview"
android:initialLayout="@layout/example_appwidget"
android:configure="com.example.android.ExampleAppWidgetConfigure"
android:resizeMode="horizontal|vertical" > </appwidget-provider>

I haven't tried, but this code should also work on previousAndroid version (3.0 as well as 2.X and 1.X)

0

精彩评论

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