kankan.wheel (http://code.google.com/p/android-wheel/) - это библиотека, которую я включаю в свой проект.Kankan.wheel on desktop widget
Если добавить колесо виджет в макете деятельности - это нормально и работает отлично, но если добавить этот компонент в настольном макете виджета - в момент добавления виджета на рабочий стол, у меня есть это:
08-08 21:02:17.630: W/AppWidgetHostView(30529): Error inflating AppWidget AppWidgetProviderInfo(provider=ComponentInfo{com.snake.vahta.counter/com.snake.vahta.counter.V ahtaAppWidgetProvider}): android.view.InflateException: Binary XML file line #89: Error inflating class kankan.wheel.widget.WheelView
И виджет Безразлично дисплей, только строка: Невозможно показать виджету
Мой файл макета XML:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:layout_margin="4dp"
android:id="@+id/widgetFrameLayout"
android:background="@drawable/background">
<LinearLayout
android:layout_marginTop="24dp"
android:layout_gravity="center_horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<kankan.wheel.widget.WheelView android:id="@+id/w_counter_100k"
android:layout_height="wrap_content"
android:layout_width="wrap_content"/>
<kankan.wheel.widget.WheelView android:id="@+id/w_counter_10k"
android:layout_height="wrap_content"
android:layout_width="wrap_content"/>
<kankan.wheel.widget.WheelView android:id="@+id/w_counter_1k"
android:layout_height="wrap_content"
android:layout_width="wrap_content"/>
<kankan.wheel.widget.WheelView android:id="@+id/w_counter_100"
android:layout_height="wrap_content"
android:layout_width="wrap_content"/>
<kankan.wheel.widget.WheelView android:id="@+id/w_counter_10"
android:layout_height="wrap_content"
android:layout_width="wrap_content"/>
<kankan.wheel.widget.WheelView android:id="@+id/w_counter_1"
android:layout_height="wrap_content"
android:layout_width="wrap_content"/>
<kankan.wheel.widget.WheelView android:id="@+id/w_counter_dot"
android:layout_height="wrap_content"
android:layout_width="wrap_content"/>
<kankan.wheel.widget.WheelView android:id="@+id/w_counter_01"
android:layout_height="wrap_content"
android:layout_width="wrap_content"/>
<kankan.wheel.widget.WheelView android:id="@+id/w_counter_001"
android:layout_height="wrap_content"
android:layout_width="wrap_content"/>
</LinearLayout>
<TextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:padding="3dip"
android:gravity="center"
android:text="@string/total_sum" />
</LinearLayout>
И что делать в этом случае? Я хочу разную компоновку – alexey
@alexey Ваш единственный вариант - работать с разрешенными макетами для создания приблизительного аналога или функционально схожих дизайнов. –
И я могу использовать ImageView. Я могу инициализировать свое представление в коде программы и преобразовать свое представление в растровое изображение. Как этот вопрос: http://stackoverflow.com/questions/4062559/android-appwidget-with-custom-view-not-working – alexey