Can you change the font size of a UIDatePicker?
In my application, I have several UIDatePickers that I need to take up about 2/3 of the screen. However, doing so currently, the month and year columns are getting truncated when in portrait. For example, instead of "2015" you'll see "..." or "Sept..." instead of "September." I've found how to scale and shrink the picker, but that doesn't seem to be fixing the problem at all.
So I was wondering if you could change the font size of the columns. That's the only way I can think of to allow all of the columns to fit short of making my own control. Which would seem incredibly unnecessary and prone to more errors when Apple already provides something with the same functionality. But if that's the only way..
ios uidatepicker
add a comment |
In my application, I have several UIDatePickers that I need to take up about 2/3 of the screen. However, doing so currently, the month and year columns are getting truncated when in portrait. For example, instead of "2015" you'll see "..." or "Sept..." instead of "September." I've found how to scale and shrink the picker, but that doesn't seem to be fixing the problem at all.
So I was wondering if you could change the font size of the columns. That's the only way I can think of to allow all of the columns to fit short of making my own control. Which would seem incredibly unnecessary and prone to more errors when Apple already provides something with the same functionality. But if that's the only way..
ios uidatepicker
add a comment |
In my application, I have several UIDatePickers that I need to take up about 2/3 of the screen. However, doing so currently, the month and year columns are getting truncated when in portrait. For example, instead of "2015" you'll see "..." or "Sept..." instead of "September." I've found how to scale and shrink the picker, but that doesn't seem to be fixing the problem at all.
So I was wondering if you could change the font size of the columns. That's the only way I can think of to allow all of the columns to fit short of making my own control. Which would seem incredibly unnecessary and prone to more errors when Apple already provides something with the same functionality. But if that's the only way..
ios uidatepicker
In my application, I have several UIDatePickers that I need to take up about 2/3 of the screen. However, doing so currently, the month and year columns are getting truncated when in portrait. For example, instead of "2015" you'll see "..." or "Sept..." instead of "September." I've found how to scale and shrink the picker, but that doesn't seem to be fixing the problem at all.
So I was wondering if you could change the font size of the columns. That's the only way I can think of to allow all of the columns to fit short of making my own control. Which would seem incredibly unnecessary and prone to more errors when Apple already provides something with the same functionality. But if that's the only way..
ios uidatepicker
ios uidatepicker
asked Sep 25 '15 at 19:38
EktrisEktris
2816
2816
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Unfortunately, no. (Reference here)
An alternative would be to make your own version using UIPickerView
As per the Documentation:
- Appearance: The appearance of UIDatePicker is not customizable.
- You should integrate date pickers in your layout using Auto Layout. Although date pickers can be resized, they should be used at their intrinsic content size.*
Darn... Really hoped there would be. Any advice on how to maintain localization with a custom UIPickerView? That's the biggest reason I didn't want to go down that route.
– Ektris
Sep 25 '15 at 20:32
If you're using NSDate you should be able to display localized or at least preference-based date formatting: developer.apple.com/library/ios/documentation/Cocoa/Conceptual/… For formatting the order of items in the picker... you could use currentLocale: developer.apple.com/library/mac/documentation/Cocoa/Reference/… This isn't by any means a full explanation, haven't thought it through fully - but hopefully it gets you on the right track!
– Chris Slowik
Sep 25 '15 at 20:41
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%2f32789463%2fcan-you-change-the-font-size-of-a-uidatepicker%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
Unfortunately, no. (Reference here)
An alternative would be to make your own version using UIPickerView
As per the Documentation:
- Appearance: The appearance of UIDatePicker is not customizable.
- You should integrate date pickers in your layout using Auto Layout. Although date pickers can be resized, they should be used at their intrinsic content size.*
Darn... Really hoped there would be. Any advice on how to maintain localization with a custom UIPickerView? That's the biggest reason I didn't want to go down that route.
– Ektris
Sep 25 '15 at 20:32
If you're using NSDate you should be able to display localized or at least preference-based date formatting: developer.apple.com/library/ios/documentation/Cocoa/Conceptual/… For formatting the order of items in the picker... you could use currentLocale: developer.apple.com/library/mac/documentation/Cocoa/Reference/… This isn't by any means a full explanation, haven't thought it through fully - but hopefully it gets you on the right track!
– Chris Slowik
Sep 25 '15 at 20:41
add a comment |
Unfortunately, no. (Reference here)
An alternative would be to make your own version using UIPickerView
As per the Documentation:
- Appearance: The appearance of UIDatePicker is not customizable.
- You should integrate date pickers in your layout using Auto Layout. Although date pickers can be resized, they should be used at their intrinsic content size.*
Darn... Really hoped there would be. Any advice on how to maintain localization with a custom UIPickerView? That's the biggest reason I didn't want to go down that route.
– Ektris
Sep 25 '15 at 20:32
If you're using NSDate you should be able to display localized or at least preference-based date formatting: developer.apple.com/library/ios/documentation/Cocoa/Conceptual/… For formatting the order of items in the picker... you could use currentLocale: developer.apple.com/library/mac/documentation/Cocoa/Reference/… This isn't by any means a full explanation, haven't thought it through fully - but hopefully it gets you on the right track!
– Chris Slowik
Sep 25 '15 at 20:41
add a comment |
Unfortunately, no. (Reference here)
An alternative would be to make your own version using UIPickerView
As per the Documentation:
- Appearance: The appearance of UIDatePicker is not customizable.
- You should integrate date pickers in your layout using Auto Layout. Although date pickers can be resized, they should be used at their intrinsic content size.*
Unfortunately, no. (Reference here)
An alternative would be to make your own version using UIPickerView
As per the Documentation:
- Appearance: The appearance of UIDatePicker is not customizable.
- You should integrate date pickers in your layout using Auto Layout. Although date pickers can be resized, they should be used at their intrinsic content size.*
edited Jan 1 at 17:23
Krishna Raj Salim
5,59252454
5,59252454
answered Sep 25 '15 at 19:42
Chris SlowikChris Slowik
2,5091623
2,5091623
Darn... Really hoped there would be. Any advice on how to maintain localization with a custom UIPickerView? That's the biggest reason I didn't want to go down that route.
– Ektris
Sep 25 '15 at 20:32
If you're using NSDate you should be able to display localized or at least preference-based date formatting: developer.apple.com/library/ios/documentation/Cocoa/Conceptual/… For formatting the order of items in the picker... you could use currentLocale: developer.apple.com/library/mac/documentation/Cocoa/Reference/… This isn't by any means a full explanation, haven't thought it through fully - but hopefully it gets you on the right track!
– Chris Slowik
Sep 25 '15 at 20:41
add a comment |
Darn... Really hoped there would be. Any advice on how to maintain localization with a custom UIPickerView? That's the biggest reason I didn't want to go down that route.
– Ektris
Sep 25 '15 at 20:32
If you're using NSDate you should be able to display localized or at least preference-based date formatting: developer.apple.com/library/ios/documentation/Cocoa/Conceptual/… For formatting the order of items in the picker... you could use currentLocale: developer.apple.com/library/mac/documentation/Cocoa/Reference/… This isn't by any means a full explanation, haven't thought it through fully - but hopefully it gets you on the right track!
– Chris Slowik
Sep 25 '15 at 20:41
Darn... Really hoped there would be. Any advice on how to maintain localization with a custom UIPickerView? That's the biggest reason I didn't want to go down that route.
– Ektris
Sep 25 '15 at 20:32
Darn... Really hoped there would be. Any advice on how to maintain localization with a custom UIPickerView? That's the biggest reason I didn't want to go down that route.
– Ektris
Sep 25 '15 at 20:32
If you're using NSDate you should be able to display localized or at least preference-based date formatting: developer.apple.com/library/ios/documentation/Cocoa/Conceptual/… For formatting the order of items in the picker... you could use currentLocale: developer.apple.com/library/mac/documentation/Cocoa/Reference/… This isn't by any means a full explanation, haven't thought it through fully - but hopefully it gets you on the right track!
– Chris Slowik
Sep 25 '15 at 20:41
If you're using NSDate you should be able to display localized or at least preference-based date formatting: developer.apple.com/library/ios/documentation/Cocoa/Conceptual/… For formatting the order of items in the picker... you could use currentLocale: developer.apple.com/library/mac/documentation/Cocoa/Reference/… This isn't by any means a full explanation, haven't thought it through fully - but hopefully it gets you on the right track!
– Chris Slowik
Sep 25 '15 at 20:41
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%2f32789463%2fcan-you-change-the-font-size-of-a-uidatepicker%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