- 浏览: 569880 次
- 性别:
- 来自: 广州
文章分类
最新评论
-
JYY282:
[i][/i]
Ecshop与Shopex的比较 -
qq247890212:
我也遇见这问题了,真诡异。重新下载个猫换了就好了。 太浪费时间 ...
诡异:ClassNotFoundException: org.springframework.web.filter.CharacterEncoding
From: http://tsyouaschen.iteye.com/blog/972683
- (void)configurePickersAndActionSheets {
CGRect pickerFrame;
if ((self.interfaceOrientation == UIInterfaceOrientationPortrait) ||
(self.interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown)) {
pickerFrame = CGRectMake(0, 180, 0, 0);
} else {
pickerFrame = CGRectMake(0,180,480,200);
}
self.areaActionSheet = [[[UIActionSheet alloc] initWithTitle:@"Area" delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles:@"Use",NULL] autorelease];
self.areaPicker = [[[UIPickerView alloc] initWithFrame:pickerFrame] autorelease];
self.areaPicker.delegate = self;
self.areaPicker.showsSelectionIndicator = YES;
[self.areaActionSheet addSubview:areaPicker];
}
上面的代码就是横屏和纵屏的大小设置
if ((self.interfaceOrientation == UIInterfaceOrientationLandscapeLeft) ||
(self.interfaceOrientation == UIInterfaceOrientationLandscapeRight)) {
[actionSheet setBounds:CGRectMake(0, 0, 480, 480)];
} else {
[actionSheet setBounds:CGRectMake(0, 0, 320, 618)];
}
此处用来设置actionsheet的大小
具体的添加PickerView如下:
UIActionSheet
*
menu
=
[
[
UIActionSheet alloc
]
initWithTitle
:
[
currentData objectAtIndex
:
0
]
delegate
:
self
cancelButtonTitle
:
@
"Done"
destructiveButtonTitle
:
@
"Cancel"
otherButtonTitles
:
nil
]
;
UIPickerView *
pickerView =
[
[
UIPickerView alloc]
initWithFrame:
CGRectMake(
0,40,480,200)
]
;
pickerView.delegate
=
self;
pickerView.showsSelectionIndicator
=
YES
;
[
menu addSubview:
pickerView]
;
[
menu showInView:
self.view]
;
[
menu setBounds:
CGRectMake(
0,0,480, 320)
]
;
[
pickerView release]
;
[
menu release]
;
OK这个就完成了ActionSheet的操作,可能你还会有一个问题就是在UIPickerView如何设置显示下拉框的
字体大小,即改变显示数组中的字体大小:
需要重写实现如下方法
- (UIView
*)pickerView:(UIPickerView
*)pickerView
viewForRow:(NSInteger
)row
forComponent:(NSInteger
)component
reusingView:(UIView
*)view
{
UILabel
*pickerLabel = (UILabel
*)view
;
if
((pickerLabel == nil
) || ([pickerView class
] != [UILabel
class
])) {
CGRect
frame = CGRectMake
(0
, 0
, 270
, 32
);
pickerLabel = [[UILabel
alloc
] initWithFrame
:frame];
pickerLabel.
textAlignment
=
UITextAlignmentLeft;
pickerLabel.
backgroundColor = [
UIColor
clearColor
];
pickerLabel.font
= [UIFont
boldSystemFontOfSize
:18
];
if
(component == kStateComponent
) {
pickerLabel.
textAlignment
=
UITextAlignmentCenter;
pickerLabel.text
= [self
.states
objectAtIndex
:row];
}
else
if
(component == kZipComponent
){
pickerLabel.
textAlignment
=
UITextAlignmentLeft;
pickerLabel.text
= [self
.zips
objectAtIndex
:row];
}
pickerLabel.textColor
= [UIColor
blackColor
];
return
pickerLabel;
}
return
0
;
}
发表评论
-
Objective-C 与 C++ 的异同
2013-04-02 12:03 1358http://www.cnblogs.com/y041039 ... -
Cocos2D-X是全球知名的开源跨平台手机游戏引擎
2013-01-22 10:05 2710http://www.oschina.net/p/cocos ... -
iOS Keyboard 键盘高度变化 自适应
2013-01-15 15:43 3219[[NSNotificationCenter default ... -
iOS使用自定义字体
2012-11-27 12:11 12077From: http://blog.csdn.net/csy1 ... -
4 款类似 Facebook/Path 切换效果的 iOS 组件
2012-11-27 12:03 2091From: http://blog.csdn.net/lia ... -
Path 2.0的UI界面设计详细介绍
2012-11-27 11:56 1426如Path的创始人Dave Morin ... -
史上最全的App Store邮箱列表
2012-11-27 11:51 1219From: http://roybaby.blog.51cto ... -
iOS从info.plist 获取项目的名称及版本号
2012-11-16 10:54 1575From: http://blog.sina.com.cn/s ... -
MapKit annotation drag and drop with callout info update
2012-10-13 10:38 2364http://hollowout.blogspot ... -
NSArray 或NSDictionary 调用writeToFile方法失败原因
2012-08-31 10:03 4423NSArray 或NSDictionary 调用writeTo ... -
如何让IOS应用从容地崩溃
2012-08-30 15:25 1572From: http://www.cocoachina.com ... -
iOS中判断设备系统版本
2012-08-29 17:17 31669在iOS开发中,经常要考虑系统的向下兼容,如果使用 ... -
iOS 汉字转拼音
2012-08-21 16:42 1425From: http://www.cnblogs.com/v2 ... -
iOS模拟器截图工具
2012-08-17 16:35 1584From: http://magicalboy.com/ios ... -
XCode下的iOS单元测试
2012-08-10 17:47 1121From: http://mobile.51cto.com/ ... -
AFNetworking
2012-08-08 10:54 4622AFNetworking on github: https:/ ... -
Wrapping Conventions
2012-08-01 15:54 781Wrapping Conventions ... -
Core Animation如何使显式动画结束时的值直接作用Layer
2012-08-01 14:51 3748(1)使用隐式动画会直接改变layer的属性值,如: ima ... -
How To Debug Memory Leaks with XCode and Instruments Tutoria
2012-07-31 16:30 1019From: http://www.raywenderlich. ... -
Using Properties in Objective-C Tutorial
2012-07-31 16:27 880From: http://www.raywenderlich. ...
相关推荐
DoActionSheet, UIActionSheet的替换 DoActionSheet替代 UIActionSheet: 基于块,可以定制主题,易于使用图像或者地图预览带有标题,带有破坏性按钮的,带有取消按钮和图像 如果按钮有许多按钮但按钮的位置是固定的...
SQActionSheetView *acitionSheet = [[SQActionSheetView alloc]initWithTitle:@"" buttons:@[@"保存图片",@"分享图片",@"取消"] buttonClick:^(SQActionSheetView *sheetView, NSInteger buttonIndex) { ...
ActionSheetPicker = UIPickerView + UIActionSheet
IOS应用源码——UIActionSheet 的美化效果.zip
IOS应用源码——UIActionSheet 的美化效果.rar
模仿IOS里面的UIActionSheet控件.rar,太多无法一一验证是否可用,程序如果跑不起来需要自调,部分代码功能进行参考学习。
BlockUI-iOS ,使用 block 做回调的 UIAlertView,UIActionSheet.UIControl ...
IBActionSheet ,IBActionSheet 是一个可完全可定制的 iOS 7 风格的 UIActionSheet 替...
FSMediaPicker ,FSMediaPicker 集成的摄像机和本地相册拾取器(UIActionSheet, UIAler...
iOS 自定义弹出菜单 UIMenuBar ,UIMenuBar 是一个 iOS 自定义弹出菜单,用于替换内置的 UIActionSheet,支持...
前两年IOS应用源码-主要是用于毕业设计学习的。
仿UIAlertView和UIActionSheet的一个效果.zipIOS应用例子源码下载仿UIAlertView和UIActionSheet的一个效果.zipIOS应用例子源码下载 1.适合学生学习研究参考 2.适合个人学习研究参考 3.适合公司开发项目技术参考
简单的自定义UIActionSheet
IOS应用源码之仿UIAlertView和UIActionSheet的一个效果 .rar
IOS应用源码——仿UIAlertView和UIActionSheet的一个效果.zip
多功能选择器UIActionSheet,仿微信ActionSheet,还有其他样式改变,满足各种需求
将封装的UIActionSheet改为UIView,为了多态初始化时添加了枚举(几个时间选择器样式)。 UIActionSheet改为UIView核心代码为以下几个方法: - (void)showInView:(UIView *)view; // UIPicker显示 -(void)...
BlockAlertsAnd-ActionSheets, 出色的UIAlertView和UIActionSheet替换灵感由 TweetBot 它是如何启动的: A的故事。自从我第一次在应用中使用UIActionSheet或者UIAlertView时,我不喜欢它的实现方式。 如果在同一类中...