下载地址 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. 初识EntityFramework6【转】

    http://www.cnblogs.com/wujingtao/p/5401132.html 什么是EF? EF是一种ORM(Object-relational mapping)框架,它能把我们在编 ...

  2. easyloader分析与使用

    转载自:http://www.cnblogs.com/haogj/archive/2013/04/22/3036685.html 使用脚本库总要加载一大堆的样式表和脚本文件,在 easyui 中,除了 ...

  3. Java7,AutoClosable

    Java 7的try-with-resource语法的目的是提高Java开发人员的效率,使得他们不需要在编写代码时考虑资源释放问题,大多数的这类"清理"问题是由于异常发生时清理方法 ...

  4. JPA(三):JPA基本注解

    基本注解 @Entity 标注用于实体类声明语句之前,指出该Java类为实体类,将映射到指定的数据库表.如声明一个实体类Customer,将它映射到数据的coustomer表上. package co ...

  5. 理解JavaScript函数参数

    前面的话 javascript函数的参数与大多数其他语言的函数的参数有所不同.函数不介意传递进来多少个参数,也不在乎传进来的参数是什么数据类型,甚至可以不传参数. arguments javascri ...

  6. Tensorflow高速入门2--实现手写数字识别

    Tensorflow高速入门2–实现手写数字识别 环境: 虚拟机ubuntun16.0.4 Tensorflow 版本号:0.12.0(仅使用cpu下) Tensorflow安装见: http://b ...

  7. GOOD BLOG URL

    1TEST http://www.cnblogs.com/Javame/p/3653509.html 综合 http://shiyanjun.cn/

  8. 【POJ 3071】 Football(DP)

    [POJ 3071] Football(DP) Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 4350   Accepted ...

  9. Python小任务 - 如何编写指定时间执行的Python小程序

    我们在平时的工作中经常会遇到这样的需求,需要再某个时间点执行一段程序逻辑. 那么,在python中我们是怎么做的呢? 下面看代码: waitDesignatedTimeToRun.py import ...

  10. asp.net正则表达式

    导入引用命名空间:using System.Text.RegularExpressions //Regex类,常用方法: //摘要:1.IsMatch(String);2.IsMatch(String ...