Android date picker does not show the title or the numbers clearly
I am an Android newbie learning how to build Android apps. I am trying to build a custom date picker for a screen. Unfortunately the numbers are being cut off at the bottom, and I don't know why. I would appreciate any feedback that I may get.
Screen as observed on the simulator
This is my layout
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_height="wrap_content"
android:orientation="vertical"
xmlns:app="http://schemas.android.com/apk/res-auto">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/date_picker_title"
android:textSize="20sp"
android:id="@+id/datepicker_title"
app:layout_constraintTop_toTopOf="parent"
style="?android:listSeparatorTextViewStyle"
android:layout_margin="16dp"/>
<DatePicker
android:id="@+id/datepicker2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:calendarViewShown="true"
android:datePickerMode="spinner"
app:layout_constraintTop_toBottomOf="@+id/datepicker_title"
android:padding="16dp" />
<Button
android:padding="16dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/datepicker2_ok"
app:layout_constraintTop_toBottomOf="@+id/datepicker2"
app:layout_constraintRight_toRightOf="parent"
android:text="@android:string/ok"/>
</android.support.constraint.ConstraintLayout>
Github project: https://github.com/manoflogan/android-projects/tree/custom_dialog/02-Criminalntent
Layout file: https://github.com/manoflogan/android-projects/blob/custom_dialog/02-Criminalntent/app/src/main/res/layout/datepicker2.xml
The functionality works as intended. I don't have a horizontal layout as yet, as I am trying to make the numbers at the bottom visible.
I am also trying to display the same screen in the horizontal layout but the title and the button at the bottom is cut off.
Here is the screen shot of the same.
Horizontal Layout
Here is the the layout which does not show the Ok button in horizontal layout.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_height="wrap_content"
android:orientation="vertical"
xmlns:app="http://schemas.android.com/apk/res-auto">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/date_picker_title"
android:textSize="16sp"
android:id="@+id/datepicker_title"
app:layout_constraintTop_toTopOf="parent"
style="?android:listSeparatorTextViewStyle"
android:layout_margin="8dp"/>
<DatePicker
android:layout_margin="8dp"
android:id="@+id/datepicker2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:calendarViewShown="true"
android:datePickerMode="spinner"
app:layout_constraintTop_toBottomOf="@+id/datepicker_title" />
<Button
android:padding="16dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/datepicker2_ok"
app:layout_constraintTop_toBottomOf="@+id/datepicker2"
app:layout_constraintRight_toRightOf="parent"
android:text="@android:string/ok"/>
</LinearLayout>
I don't know what I am doing wrong.
add a comment |
I am an Android newbie learning how to build Android apps. I am trying to build a custom date picker for a screen. Unfortunately the numbers are being cut off at the bottom, and I don't know why. I would appreciate any feedback that I may get.
Screen as observed on the simulator
This is my layout
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_height="wrap_content"
android:orientation="vertical"
xmlns:app="http://schemas.android.com/apk/res-auto">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/date_picker_title"
android:textSize="20sp"
android:id="@+id/datepicker_title"
app:layout_constraintTop_toTopOf="parent"
style="?android:listSeparatorTextViewStyle"
android:layout_margin="16dp"/>
<DatePicker
android:id="@+id/datepicker2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:calendarViewShown="true"
android:datePickerMode="spinner"
app:layout_constraintTop_toBottomOf="@+id/datepicker_title"
android:padding="16dp" />
<Button
android:padding="16dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/datepicker2_ok"
app:layout_constraintTop_toBottomOf="@+id/datepicker2"
app:layout_constraintRight_toRightOf="parent"
android:text="@android:string/ok"/>
</android.support.constraint.ConstraintLayout>
Github project: https://github.com/manoflogan/android-projects/tree/custom_dialog/02-Criminalntent
Layout file: https://github.com/manoflogan/android-projects/blob/custom_dialog/02-Criminalntent/app/src/main/res/layout/datepicker2.xml
The functionality works as intended. I don't have a horizontal layout as yet, as I am trying to make the numbers at the bottom visible.
I am also trying to display the same screen in the horizontal layout but the title and the button at the bottom is cut off.
Here is the screen shot of the same.
Horizontal Layout
Here is the the layout which does not show the Ok button in horizontal layout.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_height="wrap_content"
android:orientation="vertical"
xmlns:app="http://schemas.android.com/apk/res-auto">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/date_picker_title"
android:textSize="16sp"
android:id="@+id/datepicker_title"
app:layout_constraintTop_toTopOf="parent"
style="?android:listSeparatorTextViewStyle"
android:layout_margin="8dp"/>
<DatePicker
android:layout_margin="8dp"
android:id="@+id/datepicker2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:calendarViewShown="true"
android:datePickerMode="spinner"
app:layout_constraintTop_toBottomOf="@+id/datepicker_title" />
<Button
android:padding="16dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/datepicker2_ok"
app:layout_constraintTop_toBottomOf="@+id/datepicker2"
app:layout_constraintRight_toRightOf="parent"
android:text="@android:string/ok"/>
</LinearLayout>
I don't know what I am doing wrong.
add a comment |
I am an Android newbie learning how to build Android apps. I am trying to build a custom date picker for a screen. Unfortunately the numbers are being cut off at the bottom, and I don't know why. I would appreciate any feedback that I may get.
Screen as observed on the simulator
This is my layout
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_height="wrap_content"
android:orientation="vertical"
xmlns:app="http://schemas.android.com/apk/res-auto">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/date_picker_title"
android:textSize="20sp"
android:id="@+id/datepicker_title"
app:layout_constraintTop_toTopOf="parent"
style="?android:listSeparatorTextViewStyle"
android:layout_margin="16dp"/>
<DatePicker
android:id="@+id/datepicker2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:calendarViewShown="true"
android:datePickerMode="spinner"
app:layout_constraintTop_toBottomOf="@+id/datepicker_title"
android:padding="16dp" />
<Button
android:padding="16dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/datepicker2_ok"
app:layout_constraintTop_toBottomOf="@+id/datepicker2"
app:layout_constraintRight_toRightOf="parent"
android:text="@android:string/ok"/>
</android.support.constraint.ConstraintLayout>
Github project: https://github.com/manoflogan/android-projects/tree/custom_dialog/02-Criminalntent
Layout file: https://github.com/manoflogan/android-projects/blob/custom_dialog/02-Criminalntent/app/src/main/res/layout/datepicker2.xml
The functionality works as intended. I don't have a horizontal layout as yet, as I am trying to make the numbers at the bottom visible.
I am also trying to display the same screen in the horizontal layout but the title and the button at the bottom is cut off.
Here is the screen shot of the same.
Horizontal Layout
Here is the the layout which does not show the Ok button in horizontal layout.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_height="wrap_content"
android:orientation="vertical"
xmlns:app="http://schemas.android.com/apk/res-auto">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/date_picker_title"
android:textSize="16sp"
android:id="@+id/datepicker_title"
app:layout_constraintTop_toTopOf="parent"
style="?android:listSeparatorTextViewStyle"
android:layout_margin="8dp"/>
<DatePicker
android:layout_margin="8dp"
android:id="@+id/datepicker2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:calendarViewShown="true"
android:datePickerMode="spinner"
app:layout_constraintTop_toBottomOf="@+id/datepicker_title" />
<Button
android:padding="16dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/datepicker2_ok"
app:layout_constraintTop_toBottomOf="@+id/datepicker2"
app:layout_constraintRight_toRightOf="parent"
android:text="@android:string/ok"/>
</LinearLayout>
I don't know what I am doing wrong.
I am an Android newbie learning how to build Android apps. I am trying to build a custom date picker for a screen. Unfortunately the numbers are being cut off at the bottom, and I don't know why. I would appreciate any feedback that I may get.
Screen as observed on the simulator
This is my layout
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_height="wrap_content"
android:orientation="vertical"
xmlns:app="http://schemas.android.com/apk/res-auto">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/date_picker_title"
android:textSize="20sp"
android:id="@+id/datepicker_title"
app:layout_constraintTop_toTopOf="parent"
style="?android:listSeparatorTextViewStyle"
android:layout_margin="16dp"/>
<DatePicker
android:id="@+id/datepicker2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:calendarViewShown="true"
android:datePickerMode="spinner"
app:layout_constraintTop_toBottomOf="@+id/datepicker_title"
android:padding="16dp" />
<Button
android:padding="16dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/datepicker2_ok"
app:layout_constraintTop_toBottomOf="@+id/datepicker2"
app:layout_constraintRight_toRightOf="parent"
android:text="@android:string/ok"/>
</android.support.constraint.ConstraintLayout>
Github project: https://github.com/manoflogan/android-projects/tree/custom_dialog/02-Criminalntent
Layout file: https://github.com/manoflogan/android-projects/blob/custom_dialog/02-Criminalntent/app/src/main/res/layout/datepicker2.xml
The functionality works as intended. I don't have a horizontal layout as yet, as I am trying to make the numbers at the bottom visible.
I am also trying to display the same screen in the horizontal layout but the title and the button at the bottom is cut off.
Here is the screen shot of the same.
Horizontal Layout
Here is the the layout which does not show the Ok button in horizontal layout.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_height="wrap_content"
android:orientation="vertical"
xmlns:app="http://schemas.android.com/apk/res-auto">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/date_picker_title"
android:textSize="16sp"
android:id="@+id/datepicker_title"
app:layout_constraintTop_toTopOf="parent"
style="?android:listSeparatorTextViewStyle"
android:layout_margin="8dp"/>
<DatePicker
android:layout_margin="8dp"
android:id="@+id/datepicker2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:calendarViewShown="true"
android:datePickerMode="spinner"
app:layout_constraintTop_toBottomOf="@+id/datepicker_title" />
<Button
android:padding="16dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/datepicker2_ok"
app:layout_constraintTop_toBottomOf="@+id/datepicker2"
app:layout_constraintRight_toRightOf="parent"
android:text="@android:string/ok"/>
</LinearLayout>
I don't know what I am doing wrong.
edited Nov 19 '18 at 6:34
manoflogan
asked Nov 19 '18 at 5:42
manofloganmanoflogan
65
65
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Try to remove this line from datepicker
android:datePickerMode="spinner"
I am able to see the numbers clearly when the mode is turned off. But I am not able to see it in horizontal mode. Can you tell me why date picker mode makes the numbers unclear?
– manoflogan
Nov 19 '18 at 6:50
because layout width is starch if you check into table emulator then it work.
– Android Team
Nov 19 '18 at 6:52
It worked for me. Thank you.
– manoflogan
Nov 19 '18 at 7:35
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53368921%2fandroid-date-picker-does-not-show-the-title-or-the-numbers-clearly%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Try to remove this line from datepicker
android:datePickerMode="spinner"
I am able to see the numbers clearly when the mode is turned off. But I am not able to see it in horizontal mode. Can you tell me why date picker mode makes the numbers unclear?
– manoflogan
Nov 19 '18 at 6:50
because layout width is starch if you check into table emulator then it work.
– Android Team
Nov 19 '18 at 6:52
It worked for me. Thank you.
– manoflogan
Nov 19 '18 at 7:35
add a comment |
Try to remove this line from datepicker
android:datePickerMode="spinner"
I am able to see the numbers clearly when the mode is turned off. But I am not able to see it in horizontal mode. Can you tell me why date picker mode makes the numbers unclear?
– manoflogan
Nov 19 '18 at 6:50
because layout width is starch if you check into table emulator then it work.
– Android Team
Nov 19 '18 at 6:52
It worked for me. Thank you.
– manoflogan
Nov 19 '18 at 7:35
add a comment |
Try to remove this line from datepicker
android:datePickerMode="spinner"
Try to remove this line from datepicker
android:datePickerMode="spinner"
answered Nov 19 '18 at 5:58
Android TeamAndroid Team
7,51011033
7,51011033
I am able to see the numbers clearly when the mode is turned off. But I am not able to see it in horizontal mode. Can you tell me why date picker mode makes the numbers unclear?
– manoflogan
Nov 19 '18 at 6:50
because layout width is starch if you check into table emulator then it work.
– Android Team
Nov 19 '18 at 6:52
It worked for me. Thank you.
– manoflogan
Nov 19 '18 at 7:35
add a comment |
I am able to see the numbers clearly when the mode is turned off. But I am not able to see it in horizontal mode. Can you tell me why date picker mode makes the numbers unclear?
– manoflogan
Nov 19 '18 at 6:50
because layout width is starch if you check into table emulator then it work.
– Android Team
Nov 19 '18 at 6:52
It worked for me. Thank you.
– manoflogan
Nov 19 '18 at 7:35
I am able to see the numbers clearly when the mode is turned off. But I am not able to see it in horizontal mode. Can you tell me why date picker mode makes the numbers unclear?
– manoflogan
Nov 19 '18 at 6:50
I am able to see the numbers clearly when the mode is turned off. But I am not able to see it in horizontal mode. Can you tell me why date picker mode makes the numbers unclear?
– manoflogan
Nov 19 '18 at 6:50
because layout width is starch if you check into table emulator then it work.
– Android Team
Nov 19 '18 at 6:52
because layout width is starch if you check into table emulator then it work.
– Android Team
Nov 19 '18 at 6:52
It worked for me. Thank you.
– manoflogan
Nov 19 '18 at 7:35
It worked for me. Thank you.
– manoflogan
Nov 19 '18 at 7:35
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53368921%2fandroid-date-picker-does-not-show-the-title-or-the-numbers-clearly%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown