Skip to content

Commit

Permalink
Merge pull request #6361 from jonalter/TIMOB-16938
Browse files Browse the repository at this point in the history
Timob 16938
  • Loading branch information
jonalter committed Nov 17, 2014
2 parents fd01cfe + 6e55ae1 commit 1541ccf
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
7 changes: 6 additions & 1 deletion apidoc/Titanium/UI/Picker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -396,8 +396,13 @@ properties:

- name: font
summary: Font to use for text.
description: |
Only applicable to <Titanium.UI.PICKER_TYPE_DATE> and <Titanium.UI.PICKER_TYPE_TIME>
picker types for android. For <Titanium.UI.PICKER_PLAIN>, refer to <Titanium.UI.PickerColumn>
for android, and <Titanium.UI.PickerRow> for iphone / ipad.
type: Font

platforms: [android]

examples:
- title: Multi-Column Picker using Alloy XML Markup
example: |
Expand Down
1 change: 1 addition & 0 deletions apidoc/Titanium/UI/PickerColumn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ properties:
- name: font
summary: Font to use for text.
type: Font
platforms: [android]

examples:
- title: Multi-Column Picker
Expand Down
9 changes: 3 additions & 6 deletions apidoc/Titanium/UI/PickerRow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,10 @@ properties:
For information about color values, see the "Colors" section of <Titanium.UI>.
type: String
platforms: [mobileweb, tizen]
- name: fontSize
summary: Font size for displaying item text. Ignored when using a custom view.
type: Number
platforms: [iphone, ipad]
- name: font
summary: Font to use for the item text.
type: Font
platforms: [mobileweb, tizen]
platforms: [mobileweb, tizen, iphone, ipad]
- name: title
summary: Item text.
type: String
Expand Down Expand Up @@ -78,7 +74,8 @@ examples:
for(var i=0, ilen=color.length; i<ilen; i++){
var row = Ti.UI.createPickerRow({
title: color[i]
title: color[i],
font: {fontSize:30}
});
column2.addRow(row);
}
Expand Down
4 changes: 2 additions & 2 deletions iphone/Classes/TiUIPickerRowProxy.m
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ -(UIView*)viewWithFrame:(CGRect)theFrame reusingView:(UIView*)theView
//Upside -> It works and is performant. Accessibility is configured on the delegate

NSString *title = [self valueForKey:@"title"];
WebFont *pickerFont = [TiUtils fontValue:[self valueForKey:@"font"] def:[WebFont defaultFont]];
if (title!=nil) {
UILabel *pickerLabel = nil;

Expand All @@ -42,8 +43,7 @@ -(UIView*)viewWithFrame:(CGRect)theFrame reusingView:(UIView*)theView
pickerLabel = [[[UILabel alloc] initWithFrame:theFrame] autorelease];
[pickerLabel setTextAlignment:NSTextAlignmentLeft];
[pickerLabel setBackgroundColor:[UIColor clearColor]];
float fontSize = [TiUtils floatValue:[self valueForUndefinedKey:@"fontSize"] def:18.0];
[pickerLabel setFont:[UIFont boldSystemFontOfSize:fontSize]];
[pickerLabel setFont:[pickerFont font]];
}
[pickerLabel setText:title];
return pickerLabel;
Expand Down

0 comments on commit 1541ccf

Please sign in to comment.