Android DatePicker scrollers visualization problems
Clash Royale CLAN TAG#URR8PPP
Android DatePicker scrollers visualization problems
I have a problem with my date-picker in Android and my HTC Sensation XE.
The scrollers appears like this:
This happens only on my HTC Sensation XE. On a Samsung Galaxy S3 Mini there are no problems.
Do you know if there is a problem specific with htc?
My picker code:
<LinearLayout
android:id="@+id/ContainerMainLinearLayout"
style="@style/LoginFormContainer"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:orientation="vertical"
android:layout_alignParentTop="true"
android:layout_above="@+id/ContainerInnerRelativeLayout" >
<DatePicker
android:id="@+id/dp_bestbefore"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:paddingBottom="2dp"
android:paddingLeft="0dp"
android:paddingRight="0dp"
android:paddingTop="0dp"
android:visibility="invisible"
android:spinnersShown="true"
android:calendarViewShown="false"
android:background="@color/BackGray" />
</LinearLayout>
EDIT:
If I am right, the style:
<style name="ThemeWithTitle" parent="@android:style/Theme.Holo">
<item name="android:actionBarStyle">@style/ThemeWithTitle.ActionBar</item>
</style>
<style name="ThemeWithTitle.ActionBar" parent="@android:style/Widget.Holo.ActionBar">
<item name="android:background">@drawable/bkg_gradient_aqua</item>
<item name="android:height">40dip</item>
<item name="android:titleTextStyle">@style/ThemeWithTitle.ActionBar.TitleTextStyle</item>
</style>
1 Answer
1
@SuppressLint("SimpleDateFormat")
private fun initialiseDatePicker()
val myCalendar = Calendar.getInstance()
val date = DatePickerDialog.OnDateSetListener _, year, monthOfYear,
dayOfMonth ->
myCalendar.set(Calendar.YEAR, year)
myCalendar.set(Calendar.MONTH, monthOfYear)
myCalendar.set(Calendar.DAY_OF_MONTH, dayOfMonth)
val myFormat = "MM/dd/yyyy"
val sdf = SimpleDateFormat(myFormat)
etRegisterDob.setText(sdf.format(myCalendar.time))
etRegisterDob.setOnClickListener
val d = DatePickerDialog(this,android.R.style.Theme_Holo_Light_Dialog, date, myCalendar.get(Calendar.YEAR), myCalendar.get(Calendar.MONTH), myCalendar.get(Calendar.DAY_OF_MONTH))
d.datePicker.maxDate = System.currentTimeMillis()
d.getWindow().setBackgroundDrawableResource(android.R.color.transparent)
d.show()
a little explaination would be nice
– P i
Aug 10 at 7:20
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
Did you check it on emulator? Also please show your style
– nikis
Feb 18 '14 at 13:53