2010-01-10 3 views

답변

3

위젯에 사용할 수있는 레이아웃 및보기 목록은 Android 개발자 사이트의 app widgets article을 참조하십시오.

0

크리스토퍼가 제공하는이 목록은 기술적으로 정확하지만 아직 완전하지는 않습니다. 이러한 레이아웃과 뷰를 사용할 수 있지만 대부분의 프레젠테이션 메서드는 호출 할 수 없습니다. 프로그래밍 지원되는 위젯 중 하나 (텍스트 뷰)의 배경 색상을 변경하려고하면 예를 들어, 런타임 오류가 발생합니다 :

이 WARN/AppWidgetHostView (606) : android.widget.RemoteViews $ ActionException :보기 : android.widget.TextView는 RemoteViews에서 메서드를 사용할 수 없습니다. setBackgroundColor (int)

아직 지원되지 않는 기능과 지원되지 않는 기능에 대한 최종 목록을 아직 보지 않았습니다. android-dev 목록에서 주제에 대한 몇 가지 스레드 (one, two)를 보았습니다. work-arounds은별로 좋지 않습니다.

5

official android API에있어서, 또한 android 3.0로 시작

  • FrameLayout
  • LinearLayout
  • RelativeLayout
  • GridLayout

And the following widget classes:

  • AnalogClock
  • Button
  • Chronometer
  • ImageButton
  • ImageView
  • ProgressBar
  • TextView
  • ViewFlipper
  • ListView
  • GridView
  • StackView
  • AdapterViewFlipper

Descendants of these classes are not supported.

RemoteViews also supports ViewStub, which is an invisible, zero-sized View you can use to lazily inflate layout resources at runtime.

다음의 뷰가 지원된다 :

다음 레이아웃 클래스를 지원할 수

리모트 뷰 RemoteViews 오브젝트 (그리고, 결과적으로, App 위젯)

  • ListView - A view that shows items in a vertically scrolling list. For an example, see the Gmail app widget.
  • GridView - A view that shows items in two-dimensional scrolling grid. For an example, see the Bookmarks app widget.
  • StackView - A stacked card view (kind of like a rolodex), where the user can flick the front card up/down to see the previous/next card, respectively. Examples include the YouTube and Books app widgets.
  • AdapterViewFlipper - An adapter-backed simple ViewAnimator that animates between two or more views. Only one child is shown at a time.
관련 문제