- 浏览: 762907 次
- 性别:
- 来自: 天堂
文章分类
最新评论
-
xiaozhao-521:
呀呀呀呀呀呀呀
RequestTest222 -
Andy_hyh:
打扰了,问下openmeeting源码可以运行起来吗?
Openmeetings安装 详细步骤 -
qindongliang1922:
擦,现在还行么,厉害
北京免费吃饭的地方 -
minixx77:
...
Openmeetings安装 详细步骤 -
wwwqqqiang:
喜欢楼主分享问题的方式,有思想
UIView 和 CALayer的那点事
说明:示范如何利用AlertView来制作系统登入的介面
程式碼:
CustomAlertViewViewController.h
#import <UIKit/UIKit.h>
//記得加入UIAlertViewDelete
@interface CustomAlertViewViewController : UIViewController<UIAlertViewDelegate> {
UIAlertView *myAlertView;
}
@property (nonatomic,retain) UIAlertView *myAlertView;
-(IBAction) buttonPressed:(id)sender;
@end
CustomAlertViewViewController.m
-(IBAction) buttonPressed:(id)sender{
myAlertView=[[UIAlertView alloc] initWithTitle:@"系統登入" message:nil delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"登入",nil];
[myAlertView show];
[myAlertView release];
}
- (void)willPresentAlertView:(UIAlertView *)alertView
{
CGRect frame = alertView.frame;
if( alertView==myAlertView )
{
frame.origin.y -= 120;
frame.size.height += 80;
alertView.frame = frame;
for( UIView * view in alertView.subviews )
{
//列舉alertView中所有的物件
if( ![view isKindOfClass:[UILabel class]] )
{
//若不UILable則另行處理
if (view.tag==1)
{
//處理第一個按鈕,也就是 CancelButton
CGRect btnFrame1 =CGRectMake(30, frame.size.height-65, 105, 40);
view.frame = btnFrame1;
} else if (view.tag==2){
//處理第二個按鈕,也就是otherButton
CGRect btnFrame2 =CGRectMake(142, frame.size.height-65, 105, 40);
view.frame = btnFrame2;
}
}
}
//加入自訂的label及UITextFiled
UILabel *lblaccountName=[[UILabel alloc] initWithFrame:CGRectMake( 30, 50,60, 30 )];;
lblaccountName.text=@"帳號:";
lblaccountName.backgroundColor=[UIColor clearColor];
lblaccountName.textColor=[UIColor whiteColor];
UITextField *accoutName = [[UITextField alloc] initWithFrame: CGRectMake( 85, 50,160, 30 )];
accoutName.placeholder = @"帳號名稱";
accoutName.borderStyle=UITextBorderStyleRoundedRect;
UILabel *lblaccountPassword=[[UILabel alloc] initWithFrame:CGRectMake( 30, 85,60, 30 )];;
lblaccountPassword.text=@"密碼:";
lblaccountPassword.backgroundColor=[UIColor clearColor];
lblaccountPassword.textColor=[UIColor whiteColor];
UITextField *accoutPassword = [[UITextField alloc] initWithFrame: CGRectMake( 85, 85,160, 30 )];
accoutPassword.placeholder = @"登入密碼";
accoutPassword.borderStyle=UITextBorderStyleRoundedRect;
//輸入的資料以星號顯示(密碼資料)
accoutPassword.secureTextEntry=YES;
[alertView addSubview:lblaccountName];
[alertView addSubview:accoutName];
[alertView addSubview:lblaccountPassword];
[alertView addSubview:accoutPassword];
}
}
- (void)dealloc {
[myAlertView release];
[super dealloc];
}
发表评论
-
iOS 自定义UIActionSheet
2012-12-18 16:07 16373一:模态视图 UIActi ... -
UIView 和 CALayer的那点事
2012-11-17 23:51 30619UIView 和 CALayer的那点事 (1 ... -
iOS Open Source : Popover API for iPhone
2012-01-20 15:02 1898http://iphonedevelopertips.com/ ... -
ios 任务、线程、定时器
2011-12-26 18:09 7973一:operations(任务) cocoa提供了三种 ... -
ios url缓存策略——NSURLCache、 NSURLRequest
2011-12-26 17:09 24306一:url 缓存策略 NSURLRequest ... -
ios NSInvocation简单使用
2011-12-22 16:39 6317在ios直接调用某个对象的消息是方法有两种: 一:perfo ... -
iphone 对Web Services的三种请求方式soap get post
2011-11-09 10:57 6369一:Using SO AP 1.1 POST / ... -
sdk3.2手势实例
2011-11-09 10:11 1702#import <UIKit/UIKit.h>@i ... -
关于iphone 利用hpple解析html的问题
2011-08-04 18:28 2168最近在用happe解析html中的图片。有个翻页操作,如果请 ... -
iphone hpple 解析html,xml
2011-07-19 16:21 2705使用Objective-C解析HTML或者XML,系统自带有两 ... -
激活 iPhone通过 GPRS 连接服务器功能的代码
2011-05-13 15:14 1609如果您的 iPhone 应用里含有连接服务器的功能,也许会遇到 ... -
address book api 图型
2011-04-28 15:51 1102最近要搞地址簿了,整理一下 -
[OmniGraffle]iPhone app原型制作工具
2011-04-06 17:35 3910在写程序之前,我们通常需要做一些mockup出来(不知道款爷有 ... -
自定义uislider 样式
2011-04-04 21:28 3789UIImage *stetchLeftTrack= [[UII ... -
iphone 下AsyncSocket网络库编程
2011-04-02 21:04 7587iphone的标准推荐CFNetwork ... -
iPad UIPopoverController弹出窗口的位置和坐标
2011-04-01 17:42 1955优化规则: TodoViewControlle ... -
iPhone系统自动化测试
2011-04-01 17:39 2570首先mac系统是必备的2 安装iPhone SD ... -
iphone上面编写具有root权限的程序
2011-04-01 17:31 6240正常途径下, 我们编写的程序发布在App store上, 使用 ... -
聊天。。。。。
2011-04-01 17:13 1050是得分手段 -
iOS开发基础:Modal View Controller的不同呈现方式
2011-04-01 16:40 2772ModalViewController可以有不同的呈现方式(m ...
相关推荐
Demo 和 AnimateGif 详见Github https://github.com/hkm5558/KMAlertView 求Star
vue-ios-alertview Vue 2的iOS7 +样式Alertview服务angular-ios-alertview的Vue端口。 安装npm install vue-ios-alertview依赖关系Promise用法从'vue'导入Vue; 导入vue-ios-alertview的Vue 2的iOS7 +样式Alertview...
自定义alertView,支持ios7,大家可以参考一下
自定义三种状态的AlertView--成功、警告、错误,可以直接调用,采用动画效果炫酷
适用于iOSSDK的自定义AlertView。_Objective-C_Ruby_下载.zip
DXAlertView-master是一个提示框类
快速实现自定义alertView
自定义alertview,一款封装好的自定义alertview控件,多样化alertview的使用
vue-ios-alertview是iOS7 风格的alertview服务,angular-ios-alertview的Vue移植
1.)//登录输入框类型alertView-- +(void)showAlertLoginInputWithMessage:(NSString*)message title:(NSString*)title cancelButtonTitle:(NSString *)cancelButtonTitle otherButtonTitles:(NSArray *)...
想象不到的便捷,用过的都说好...在原BlockAlertView的基础上,新增了PlainText样式的alertView. 利用Block进行回调,一句代码就可以完成alertView的创建和代理方法。再也不需要去写tag属性来区分alertView的点击事件了
ConfigueAlertView *alertView = [[ConfigueAlertView alloc] initWithFrame:CGRectMake(0, 0, ScreenWidth, ScreenHeight)withGroupNumber:10]; alertView.delegate = self; alertView.backgroundColor = ...
自定义alertView弹出框
带tableView的AlertView,用于选择用户等场景。
自定义 AlertView
iOS 自定义AlertView,使用简单
自定义alertView;支持带图标,自定义视图的alertView
可以网络加载图片可网络加载文字,可自定义alertView颜色等等,东西很简单,但是我对颜色不敏感,所有设置的颜色不那么亮眼,代码很容易看懂,自己修改也方便。里面包含了mas框架。。