自定义UIAlertView可以容纳多个按钮

下载:FSAlertView

Customization UIView replace UIAlertView can include a lot of Buttons,the FSAlertView would be placed between Top Bar and Bottom Bar and automatically scroll well.

Features

  • Works like UIAlertView.So does the Init,Delegate.
  • Runs on iOS5,6,7,8.
  • Non-ARC.

What
you need

How
to use

- (void)more{

    FSAlertView *moreAlert = [[FSAlertView alloc] initWithTitle:@"title"
                                                        message:@"the FSAlertView message: please click the buttons"
                                                       delegate:self
                                              cancelButtonTitle:@"cancel"
                                              otherButtonTitles:@"button 1",@"button 2",@"button 3"
                                                                ,@"button 4",@"button 5",@"button 6"
                                                                ,@"button 7",@"button 8",@"button 9",@"button 10", nil];

    [moreAlert showInView];
    [moreAlert release];
}

#pragma mark -
#pragma mark -FSAlertViewDelegate
- (void)fsAlertView:(UIView*)fsAlertView clickedButtonAtIndex:(NSInteger)buttonIndex {

}

No
Title

    FSAlertView *moreAlert = [[FSAlertView alloc] initWithTitle:nil
                                                        message:@"the FSAlertView message: please click the buttons"
                                                       delegate:self
                                              cancelButtonTitle:@"cancel"
                                              otherButtonTitles:@"button 1",@"button 2",@"button 3"
                                                                ,@"button 4",@"button 5",@"button 6"
                                                                ,@"button 7",@"button 8",@"button 9",@"button 10", nil];

No
Message

    FSAlertView *moreAlert = [[FSAlertView alloc] initWithTitle:@"title"
                                                        message:nil
                                                       delegate:self
                                              cancelButtonTitle:@"cancel"
                                              otherButtonTitles:@"button 1",@"button 2",@"button 3"
                                                                ,@"button 4",@"button 5",@"button 6"
                                                                ,@"button 7",@"button 8",@"button 9",@"button 10", nil];

No
Cancel

    FSAlertView *moreAlert = [[FSAlertView alloc] initWithTitle:@"title"
                                                        message:@"the FSAlertView message: please click the buttons"
                                                       delegate:self
                                              cancelButtonTitle:nil
                                              otherButtonTitles:@"button 1",@"button 2",@"button 3", nil];

No
Button

If cancelButtonTitle and otherButtonTitles both be nil,the FSAlertView would be disappear after 3 seconds.

    FSAlertView *moreAlert = [[FSAlertView alloc] initWithTitle:@"title"
                                                        message:@"the FSAlertView message: please click the buttons"
                                                       delegate:self
                                              cancelButtonTitle:nil
                                              otherButtonTitles:nil];

Only
Button

    FSAlertView *moreAlert = [[FSAlertView alloc] initWithTitle:nil
                                                        message:nil
                                                       delegate:self
                                              cancelButtonTitle:@"cancel"
                                              otherButtonTitles:@"button 1",@"button 2",@"button 3"
                                                                ,@"button 4",@"button 5",@"button 6"
                                                                ,@"button 7",@"button 8",@"button 9",@"button 10", nil];

Has
Two Button

    FSAlertView *moreAlert = [[FSAlertView alloc] initWithTitle:@"title"
                                                        message:@"the FSAlertView message: please click the buttons"
                                                       delegate:self
                                              cancelButtonTitle:@"cancel"
                                              otherButtonTitles:@"button 1", nil];
    // or
    FSAlertView *moreAlert = [[FSAlertView alloc] initWithTitle:@"title"
                                                        message:@"the FSAlertView message: please click the buttons"
                                                       delegate:self
                                              cancelButtonTitle:nil
                                              otherButtonTitles:@"button 1",@"button 2", nil];

 

时间: 2024-08-10 08:31:27

自定义UIAlertView可以容纳多个按钮的相关文章

自定义UIAlertView

code4App上面有很多很棒的UI特效代码,我们常感叹,好牛逼啊,这效果,太炫了,哇,怎么自己写不出来.其实,再炫的特效,都是根据苹果系统的框架而来,如果我们了解系统框架实现的原理,也就能写出属于自己自定义的控件,加上各种各样的动画. 这里,我就展示一个自定义的UIAlertView效果控件,视图出现的时候动画-先放大-再缩小-最后成正常比例,消失的时候缩小加渐隐.调用也很方便,不需要像系统先创建后[alert show],我在类内部就已经写好了,只需要alloc创建,调用各个按钮对应的响应b

Android自定义组合控件--底部多按钮切换

效果图: 现在市场上大多数软件都是类似于上面的结构,底部有几个按钮用于切换到不同的界面.基于OOP思想,我想把下面的一整块布局封装成一个类,也就是我们的自定义组合控件-底部多按钮切换布局,我把它叫做BottomLayout 看上面的布局,几个按钮横向排列,我们先看一下布局 最外面LinearLayout 方向 horizontal,然后5个weight相同的RelativeLayout,每个RelativeLayout里面有一个Button(用了显示选中状态)个ImageView(用来显示红点)

Android自定义View——圆形进度条式按钮

介绍 今天上班的时候有个哥们问我怎么去实现一个按钮式的进度条,先来看看他需要实现的效果图. 和普通的圆形进度条类似,只是中间的地方有两个状态表示,未开始,暂停状态.而且他说圆形进度的功能已经实现了.那么我们只需要对中间的两个状态做处理就行了. 先来看看实现的效果图: 上面说了我们只需要处理中间状态的变化就可以了,对于进度的处理直接使用了弘洋文章中实现: http://blog.csdn.net/lmj623565791/article/details/43371299 下面开始具体实现. 具体实

利用WordPress自定义字段为文章添加下载按钮

树经常要上传一些资源来给大家分享,但是每次都要手动加链接,关联图片,十分麻烦,于是就利用了一下wordpress的自定义字段功能来自动添加下载按钮下面就来说说怎么实现这个功能吧~其实方法很简单,利用的就是下面这一段代码 <?php if(get_post_meta($post->ID, "download", $single = true) != ""){ ?> <div id="download"> <a h

iphone:自定义UIAlertView

由于项目中有这样一个需求:需要在保存是弹出框选择保存的地点.选择UIAlertView来实现,但是要在UIAlertView中增加UISwitch的控件,这就需要自定义一个继承UIAlertView的类来自定义UIAlertView了. 实现效果如下:(还没加图的) 我需要在点击确定的时候,知道两个Switch的状态,才能进一步做相应的功能. 自定义了SaveAlertView类. 在.h中,需要自定义一个@protocol,作为把switch状态传出去的出口. 声明相应的委托.看源码 #imp

Android 自定义View,仿微信视频播放按钮

闲着,尝试实现了新版微信视频播放按钮,使用的是自定义View,先来个简单的效果图...真的很简单哈. 由于暂时用不到,加上时间原因,加上实在是没意思,加上……,本控件就没有实现自定义属性,有兴趣的朋友可以自己去添加一下,方法都给你们准备好了.- = 其实这个控件主要步骤 1.画外环的圆 2.画进度的圆或者画三角形播放按钮 其余剩下的都是围绕以上两步准备或者收尾的. 接下来贴主要我们的自定义控件代码,注释很全,我就不过多解释了,请各位看官自己分析,有疑问可以在评论区一起讨论. package co

导航条的自定义:背景颜色设置,按钮标题图片设置,图片坐标修改

一.修改系统原生导航条 修改导航条背景颜色 self.navigationController.navigationBar.barTintColor = [UIColor colorWithHexString:@"#2295f2"]; 自定义导航条按钮 self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]initWithImage:[UIImage imageNamed:@"btn-menu-h&q

WordPress自定义字段为文章添加下载按钮

网站经常要上传文件,但是每次都要手动加链接,关联图片,十分麻烦,于是就利用了一下wordpress的自定义字段功能来自动添加下载按钮下面就来说说怎么实现这个功能吧~其实方法很简单,利用的就是下面这一段代码 <?php if(get_post_meta($post->ID, "download", $single = true) != ""){ ?> <div id="download"> <a href=&qu

IOS 自定义导航栏标题和返回按钮标题

IOS中自定义导航栏标题: UILabel *titleText = [[UILabel alloc] initWithFrame: CGRectMake(160, 0, 120, 50)]; titleText.backgroundColor = [UIColor clearColor]; titleText.textColor=[UIColor whiteColor]; [titleText setFont:[UIFont systemFontOfSize:17.0]]; [titleTex