方便的弹出视图,可随意定义箭头方向,自动计算位置
2016-06-23 17:09
399 查看
笔者平常也要使用这些工具,但总是不好找到一个方便可高度自定义的,所以自己制作了一个
使用方法:
demo下载:https://github.com/shengpeng3344/SimplePopView
使用方法:
简单使用 - (instancetype)initWithFrame:(CGRect)frame andDirection:(PopViewDirection)direction andTitles:(NSArray *)titles;
自定义使用 - (instancetype)initWithFrame:(CGRect)frame andDirection:(PopViewDirection)direction andTitles:(NSArray *)titles andImages:(NSArray *)images trianglePecent:(float)percent; SimplePopupView *popView = [[SimplePopupView alloc]initWithFrame:CGRectMake(50, 50, 120, 80) andDirection:PopViewDirectionRight andTitles:tmpArray andImages:images trianglePecent:0.5];
//1.直接加入指定位置 SimplePopupView *popView = [[SimplePopupView alloc]initWithFrame:CGRectMake(50, 50, 120, 80) andDirection:PopViewDirectionRight andTitles:tmpArray]; [self.view addSubview:popView]; //响应事件中调用show方法 [popView show];
//2.调用UIView+SimplePopupView中方法 SimplePopupView *popView0 = [[SimplePopupView alloc]initWithFrame:CGRectMake(50, 50, 120, 80) andDirection:PopViewDirectionRight andTitles:tmpArray andImages:images trianglePecent:0.5]; //箭头位于popview右边缘中间0.5位置 [_button showPopView:popView0 AtPoint:CGPointMake(0, 0.5)];//箭头位于button的x=0.y=0.5比例处 //然后响应事件中调用show方法 [popView0 show]; //这样popview就会显示在button的设置位置
demo下载:https://github.com/shengpeng3344/SimplePopView
相关文章推荐
- 个人写的第一个效果
- Iphone开发,做弹出视图Popup View
- Android-高德地图-显示气泡框
- PopupView
- PopupView
- IOS中UIActionSheet使用详解
- PopupView实现两级下拉列表
- _BSMachError: (os/kern) invalid capability (20)和_BSMachError: (os/kern) invalid name (15)解决方法
- UIAlertController
- iOS弹出视图-swift
- IOS开发仿微信右侧弹出视图实现
- 初见Linux
- centos下nginx的负载均衡搭建(图文详解)
- gerrit install
- centos安装samba
- Linux中查看某 个软件的安装路径
- 安卓学习笔记—popupwindow
- copy
- 解决mount.nfs: access denied by server while mounting 192.168.1.185:/opt/embedsky
- Linux的三种同步操作比较