【问题标题】:Two datepickers open at the same time Is it possible?两个日期选择器同时打开有可能吗?
【发布时间】:2018-08-15 23:59:22
【问题描述】:

我需要在 IO 中输入类似于此应用程序的初始日期和最终日期:

Gif video about IOs app

我正在考虑使用 DatePicker 输入初始日期,然后输入另一个或相同的日期作为最终日期。

但是我的老板希望同时查看 DatePicker 的开始日期和结束日期。这可能吗?

或者有一种方法可以做类似于前面提到的视频 gif 的事情。

谢谢

【问题讨论】:

    标签: android date datepicker


    【解决方案1】:

    你可以像下面这样使用 2 个日期选择器,

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"
       >
    
        <ScrollView
            android:layout_width="match_parent"
            android:layout_height="match_parent">
    
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:orientation="vertical"
                >
    
                <DatePicker
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"                
    
                    ></DatePicker>
    
                <DatePicker
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content">
    
                </DatePicker>
    
    
    
            </LinearLayout>
        </ScrollView>
    
    
    
    
    
    </LinearLayout>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-02-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多