ios UISwipeGestureRecognizer 左右滑动隐藏按钮
来源:互联网 发布:pdf拆分软件绿色版 编辑:程序博客网 时间:2024/06/16 09:01
#import "loginSuccessViewController.h"@interface loginSuccessViewController (){ UIButton *_ljBackButton;}@end@implementation loginSuccessViewController- (void)viewDidLoad{ [super viewDidLoad]; _ljBackButton = [UIButton buttonWithType:UIButtonTypeCustom]; [_ljBackButton setFrame:CGRectMake(100, 200, 100, 44)]; [_ljBackButton setBackgroundColor:[UIColor grayColor]]; //[_ljBackButton addTarget:self action:@selector(backButtonClick) forControlEvents:UIControlEventTouchUpInside]; [_ljBackButton setTitle:@"测试" forState:UIControlStateNormal]; [_ljBackButton setTitleColor:[UIColor redColor] forState:UIControlStateNormal]; [self.view addSubview:_ljBackButton]; // 添加右滑移除手势 UISwipeGestureRecognizer *swipeRight = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeToDirection:)]; swipeRight.direction = UISwipeGestureRecognizerDirectionRight; [_ljBackButton addGestureRecognizer:swipeRight]; // 添加右滑移除手势 UISwipeGestureRecognizer *swipeLeft = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeToDirection:)]; swipeRight.direction = UISwipeGestureRecognizerDirectionLeft; [_ljBackButton addGestureRecognizer:swipeLeft];}- (void)swipeToDirection:(UISwipeGestureRecognizer *)swipeGesture{ if (swipeGesture.direction == UISwipeGestureRecognizerDirectionRight) { // 向右滑动 NSLog(@"-----DirectionRight"); [_ljBackButton setHidden:YES]; } else if (swipeGesture.direction == UISwipeGestureRecognizerDirectionLeft) { // 向左滑动 NSLog(@"-----DirectionLeft"); [_ljBackButton setHidden:YES]; }}@end
阅读全文
0 0
- ios UISwipeGestureRecognizer 左右滑动隐藏按钮
- IOS 手势之左右滑动UISwipeGestureRecognizer
- iOS 手势之左右滑动UISwipeGestureRecognizer
- iOS:点击按钮或者手势控制界面左右滑动
- UISwipeGestureRecognizer 左右翻页问题
- ios 左右滑动手势
- UISwipeGestureRecognizer滑动手势
- ios左右滑动页面刷新
- IOS 手势之左右滑动
- 移动端按钮组左右滑动
- swiftUI基础 滑动手势UISwipeGestureRecognizer
- ios按钮滑动切换
- iOS添加左右导航按钮
- 左右滑动弹出按钮,类似于QQ中,左右滑动消息框会弹出删除等按钮
- [iOS]iOS中UITabbarController左右滑动切换
- iOS实现左右循环滑动ScrollVIew
- iOS开发-UITableView-3(左右滑动)
- iOS之UITableViewCell左右滑动效果
- vc中for循环中多变量初始化的坑
- 同一个activity下的两个子fragment的数据传输
- ifneq (,$(filter $(strip $(TARGET_BOARD_PLATFORM)), mt6735m mt6737m))
- JSP
- Java的集合框架最全详解(图)
- ios UISwipeGestureRecognizer 左右滑动隐藏按钮
- java通过JDBC驱动连接操作hive实例
- 链表第k个点
- 单页web应用是什么?它又会给传统网站带来哪些好处?
- AK08815 地磁学习
- aspx头部代码<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ceshi.aspx.cs" Inherits="SM_ceshi" %
- win10使用administrator登录却仍然没权限
- Mac软件下载网站
- jsp之JavaBean入门