Issue
val datePickerDialog = DatePickerDialog(
this@AddTaskActivity,
R.style.DateTimePickerTheme,
startDatePickerListener,
myCalendar
.get(Calendar.YEAR),
myCalendar.get(Calendar.MONTH),
myCalendar.get(Calendar.DAY_OF_MONTH)
)
<style name="DateTimePickerTheme" parent="Theme.AppCompat.Light.Dialog">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/theme_blue</item>
</style>
above is my code , view showing as above image 1. but expected as below image 2. there is Unwanted date is top of the date picker
Solution
You have to remove title bar. To Remove title bar.. use this code
datePickerDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
And Don't call datePickerDialog.setTitle("title")
Remove setTitle if you use
datePickerDialog.setTitle("title")
Answered By - Md. Enamul Haque
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.