为什么在日期选择器添加一个日历在我的观点吗? [英] Why does the datepicker add a calendar in my view?
本文介绍了为什么在日期选择器添加一个日历在我的观点吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我开始学习如何开发在Android上。这是pretty的简单,但我现在面临一个问题,我没有发现任何提及任何地方......
I am starting to learn how to develop on Android. It is pretty straightforward but I'm facing an issue I did not find any mention anywhere...
我有一个观点:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:orientation="vertical">
<EditText
android:id="@+id/editNomProduit"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:ems="10"
android:hint="@string/ht_nom_produit" />
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:orientation="horizontal">
<TextView
android:id="@+id/labelQuantiteProduitEdit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/labelQuantiteProduitEdit"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="@+id/editQuantite"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="number" />
<Spinner
android:id="@+id/spinnerUnite"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:orientation="horizontal">
<TextView
android:id="@+id/labeDateAchatProduitEdit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/labelDateAchatProduitEdit"
android:textAppearance="?android:attr/textAppearanceMedium" />
<DatePicker
android:id="@+id/dpDateAchatProduit"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>
其中显示的日期选择器。问题是,日期选取器似乎添加日历除了传统的辊的日期选择器(见图片)。我不希望这个观点,在探微滚轮的日期。难道我usign日期选取器以错误的方式或者这是一部开拓创新的行为吗? 谢谢!
Which displayed a datepicker. The thing is that the date picker seems to add a Calendar besides the classic rollers for the date picker (see picture). I don't want this view, juste the roller for the date. Am I usign the date picker in the wrong way or is this the orignal behavior ? Thanks !
纪尧姆
推荐答案
将此行添加到您的日期选择器的XML
Add this line to your date picker xml
android:calendarViewShown="false"
这将删除该日历。
这篇关于为什么在日期选择器添加一个日历在我的观点吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文