0

I would like to add a view to my app that shows the list of days, with the user being able to select 1 or more days (for calendar-like repetition behavior).

The concept looks like this:

Sun | Mon | Tue | Wed | Thu | Fri | Sat

I first thought about using a ListView but there are 2 problems I can think of with that approach:

  • ListView only shows items vertically and not horizontally (by default).
  • There are only 7, static items. I'm not sure whether using a ListView is better than just doing it manually (LinearLayout with 7 buttons; 1 for each day).

So my question is; what is the best way to achieve it?

*I know there is already a library for an horizontal ListView, but it's not maintained anymore, and problems are not being solved, so it's not an option.

4

2 回答 2

3

一组七个复选框、开关或切换按钮可以工作。您使用哪一种取决于您要达到的视觉效果。

因为您没有滚动列表或更改基础数据 (*),所以列表视图不会为您的代码增加任何实际价值和相当大的复杂性

(*) 除非您找到一种方法可以在一周中增加一天,在这种情况下,我真的很想听听!我需要它。

于 2013-10-11T17:04:57.973 回答
2

再次,看看这个“电话日程”android 教程项目

在此处输入图像描述

然后,您可以按照您想要的方式自定义这些复选框。

不幸的是,我找不到与您在 Android 中创建的 UI 完全相同的副本。我找到的最接近的是下面 2013 年 5 月 Google 日历更新中捆绑的新重复对话框。

在此处输入图像描述

于 2013-10-11T17:54:35.437 回答