gpt4 book ai didi

android - 修改堆栈项目计数并在堆栈 View 中显示 ListView / GridView

转载 作者:行者123 更新时间:2023-11-29 22:09:22 24 4
gpt4 key购买 nike

我有两个问题要问。我指的是 http://www.broculos.net/en/article/android-101-how-create-stackview-widget创建堆栈 View 小部件。

  1. 默认堆栈 View 显示 4 个堆叠在一起的项目。我们可以更改此计数吗?例如,在附图中 http://www.broculos.net/sites/default/files/resize/content/honeybuzz_widget_preview-200x125.png , HoneyBuzz 小部件显示 4 个项目,但 Map 小部件显示 3 个。如何做到这一点?

  2. 我还想知道我们能否在 stackview 中添加 Listview 和 Gridview。意思是,既然我们可以在单个堆栈项目中显示文本/图像,我们可以显示列表/网格并滚动浏览它吗?

最佳答案

  1. 不,你不能。

  2. 我认为在堆栈 ListView 中滚动会阻止用户更改堆栈中的“卡片”,因此这是不可能的

来自安卓开发者网站:

Creating the App Widget layout is simple if you're familiar with XML Layouts. However, you must be aware that App Widget layouts are based on RemoteViews, which do not support every kind of layout or view widget.

A RemoteViews object (and, consequently, an App Widget) can support the following layout classes:

  • FrameLayout LinearLayout RelativeLayout And the following widget classes:
  • AnalogClock
  • Button
  • Chronometer
  • ImageButton
  • ImageView
  • TextView
  • ViewFlipper
  • ListView
  • GridView
  • StackView
  • AdapterViewFlipper

Descendants of these classes are not supported.

关于android - 修改堆栈项目计数并在堆栈 View 中显示 ListView / GridView ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10025573/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com