Android 4.2에 도입 된 잠금 화면 위젯에 대한 참조를 찾는 데 많은 어려움을 겪고 있습니다.잠금 화면 위젯이 너무 작음
나는 런처에서 잘 작동하는 위젯을 만들었으며 예상 한대로 크기가 조정되었습니다. 그러나이 위젯을 잠금 화면에 올리면 올바르게 수직으로 크기가 조정되지 않습니다. 위젯이 같은 수직 크기 조정 자체를 표시하는 경우
http://developer.android.com/guide/topics/appwidgets/index.html#lockscreen에 따르면 그 다음 위젯 높이가 표시 세로 전화에 "작은"으로 표시됩니다, 당신은 android:resizeMode="vertical"
설정하면 수직으로 사용할 수있는 크기를 차지합니다 UI 잠금 해제. 다른 모든 경우 위젯 크기는 사용 가능한 높이를 채 웁니다.
또한 제가 http://developer.android.com/guide/practices/ui_guidelines/widget_design.html
타일에 기재된 정립> 크기를 사용
- 1> 40dp
- 2> 110dp
- 3> 180dp
- 4> 250dp
- ...> ...
- N> 70 × N - 30
나는이 설정 한과에서는 "작은"위젯보다 더 작게 나타납니다. 기본적으로, 사람이 위젯에 무엇이 잘못되었는지 알고 있습니까? image 1 확장되지 않습니다. 내 코드는 아래와 같습니다.
1) 기본 상태로 표시됩니다. 또 다른 화면에 확장 할 때 보이는 무엇
2). 이것은 단지 에뮬레이터에서 일어나는처럼
XML/clock_widget.xml
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
android:initialKeyguardLayout="@layout/clock_widget"
android:initialLayout="@layout/clock_widget"
android:minHeight="110dp"
android:minWidth="180dp"
android:resizeMode="vertical"
android:updatePeriodMillis="1000"
android:widgetCategory="keyguard|home_screen" >
</appwidget-provider>
레이아웃/clock_widget.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/clock_widget"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/widget_hour"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="36sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=":"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="36sp" />
<TextView
android:id="@+id/widget_minute"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="36sp" />
</LinearLayout>
<TextView
android:id="@+id/widget_date"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text=""
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
minHeight를 루트 LinearLayout에 추가하려고 했습니까? –