下载地址 http://pan.baidu.com/share/link?shareid=2894506499&uk=923776187

引用这几个文件

radiobutton。封装好单选按钮

DataPicker  封装好选择器

jiugongge  九宫格

commonButton 这个是公用的button.

nsCategory

使用方式

#import <UIKit/UIKit.h>
#import "RadioButtonExt.h" @interface ViewController : UIViewController<RadioButtonExtDelegate> @end #import "ViewController.h"
#import "DIYJGGView.h"
#import "JSPresentCommonViewCtrl.h"
#import "PresentView.h" @interface ViewController () @end @implementation ViewController - (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
[self RadioButtonSelect];
UIButton *btn=[UIButton buttonWithType:UIButtonTypeRoundedRect];
btn.frame=CGRectMake(, , ,);
[self.view addSubview:btn];
[btn addTarget:self action:@selector(click:) forControlEvents:UIControlEventTouchUpInside]; } #pragma mark -radiobutton
-(void)RadioButtonSelect{
NSArray *arr=@[@"标题1",@"标题2",@"标题3"];
RadioButtonExt *ext=[[RadioButtonExt alloc] initWithFrame:CGRectMake(, , , ) data:arr];
ext.delegate=self;
ext.backgroundColor=[UIColor redColor];
[self.view addSubview:ext];
[ext release]; } #pragma mark -DataPicker
-(void)click:(UIButton *)btn{
for (UIViewController *vc in self.childViewControllers) {
[vc removeFromParentViewController];
}
// JSPresentCommonViewCtrl *pre=[[JSPresentCommonViewCtrl alloc] initWithPresentType:1 WithDataArray:nil];//日期
JSPresentCommonViewCtrl *pre=[[JSPresentCommonViewCtrl alloc] initWithPresentType: WithDataArray:@[@"标题一",@"标题二"]];//选择
CGRect hrect,rect=self.view.bounds;
pre.delegate=self;
pre.method=@selector(selectData:);
CGRectDivide(rect, &hrect, &rect, , CGRectMaxYEdge);
[PresentView showWithSubView:pre.view subVFrame:hrect];
[self addChildViewController:pre];
[pre release];
} #pragma mark -单选按钮的代理方法
-(void)RadioButton:(RadioButtonExt *)rd from:(NSInteger)from to:(NSInteger)to{
NSLog(@"_from--%zi--->to-->%zi",from,to);
}
#pragma mark -DataPicker代理方法
-(void)selectData:(NSString *)selectStr{
[PresentView hidePresentSubView];
NSLog(@"__>%@",selectStr);
} @end

ios中 radioButton和DataPIcker,九宫格封装好使用的更多相关文章

  1. ios中radiobutton

    #import <UIKit/UIKit.h> @protocol RadioButtonExtDelegate; @interface RadioButtonExt : UIView - ...

  2. QF——iOS中的数据库操作:SQLite数据库,第三方封装库FMDB,CoreData

    SQLite数据库: SQLite是轻量级的数据库,适合应用在移动设备和小型设备上,它的优点是轻量,可移植性强.但它的缺点是它的API是用C写的,不是面向对象的.整体来说,操作起来比较麻烦.所以,一般 ...

  3. 转载 -- iOS中SDK的简单封装与使用

    一.功能总述 在博客开始的第一部分,我们先来看一下我们最终要实现的效果.下图中所表述的就是我们今天博客中要做的事情,下方的App One和App Two都植入了我们将要封装的LoginSDK, 两个A ...

  4. iOS中数据库应用基础

    iOS 数据库入门 一.数据库简介 1.什么是数据库? 数据库(Database) 是按照数据结构来组织,存储和管理数据的仓库 数据库可以分为2大种类 关系型数据库(主流) PC端 Oracle My ...

  5. iOS 中的 HotFix 方案总结详解

    相信HotFix大家应该都很熟悉了,今天主要对于最近调研的一些方案做一些总结.iOS中的HotFix方案大致可以分为四种: WaxPatch(Alibaba) Dynamic Framework(Ap ...

  6. Quartz 2D在ios中的使用简述二:创建画布

    在iOS中使用Quartz画图时,第一步就是要获取画布(图形上下文),然后再画布上做各种操作.先看下CoreGraphics.h这个头文件,就可以知道能够创建多少种上下文类型. #include &l ...

  7. 谈谈iOS中的锁

    1 前言 近日工作不是太忙,刚好有时间了解一些其他东西,本来打算今天上午去体检,但是看看天气还是明天再去吧,也有很大一个原因:就是周六没有预约上!闲话少说,这里简单对锁来个简单介绍分享. 2 目录 第 ...

  8. iOS中的数据持久化方式

    iOS中的数据持久化方式,基本上有以下四种:属性列表.对象归档.SQLite3和Core Data. 1.属性列表 涉及到的主要类:NSUserDefaults,一般 [NSUserDefaults ...

  9. iOS中多线程原理与runloop介绍

    一.线程概述 有些程序是一条直线,起点到终点:有些程序是一个圆,不断循环,直到将它切断.直线的如简单的Hello World,运行打印完,它的生命周期便结束了,像昙花一现那样:圆如操作系统,一直运行直 ...

随机推荐

  1. 领扣-754 到达终点数字 Reach a Number MD

    Markdown版本笔记 我的GitHub首页 我的博客 我的微信 我的邮箱 MyAndroidBlogs baiqiantao baiqiantao bqt20094 baiqiantao@sina ...

  2. 用JQuery 判断某个属性是否存在hasAttr的解决方法

    在jquery编码中,我们会判断元素是否存在某个属性.比如是否包含 class="new" 的样式呢.JQuery判断就非常简单了,因为有 hasClass这个方法 $(" ...

  3. vue项目实现列表页-详情页返回不刷新,再点其他菜单项返回刷新的需求

    问题背景:有时候一些列表会有一些跳转的需求,比如跳到详情页.或者是其他相关的页面(比如跳到用户列表去查看用户的相关信息)等,此时再返回列表页,列表页会刷新重置.目前需求就是需要改成如下情况: 问题1. ...

  4. 转:TensorFlow入门(六) 双端 LSTM 实现序列标注(分词)

    http://blog.csdn.net/Jerr__y/article/details/70471066 欢迎转载,但请务必注明原文出处及作者信息. @author: huangyongye @cr ...

  5. Centos安装gcc及g++

    Centos支持yum安装,安装软件一般格式为yum install .......,注意安装时要先成为root用户. 按照这个思路,我想安装过程如下: 安装gcc:yum install gcc 安 ...

  6. xshell5不能用

    转载:xshell 5 不能用 https://51.ruyo.net/10002.html

  7. (转)Unity3D 游戏贴图(法线贴图,漫反射贴图,高光贴图)

    原帖网址http://www.u3dpro.com/read.php?tid=207  感谢jdk900网友的辛苦编写 我们都知道,一个三维场景的画面的好坏,百分之四十取决于模型,百分之六十取决于贴图 ...

  8. Log4j日志体系结构

    转自:https://my.oschina.net/andylucc/blog/794867 摘要 我们在写日志的时候首先要获取logger,在每一个使用log4j的项目都有很多个地方要获取logge ...

  9. C++ 函数适配器

    1.考虑下面的需求,在一个int的vector中,找出一个比5的元素,容易想到的解决办法,定义一个方法对象,使用模板,如下:vector<int>::iterator iter = fin ...

  10. JS与Jquery的事件委托

    参考:http://www.ituring.com.cn/article/467 概念: 什么是事件委托:通俗的讲,事件就是onclick,onmouseover,onmouseout,等就是事件,委 ...