1:获取某一行的坐标

UITableViewCell *cell = [_myTableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow: inSection:]];

[tipsView setY:CGRectGetMaxY(cell.frame) - 0.5];

- (void)setY:(CGFloat)y{

    CGRect frame = self.frame;

    frame.origin.y = y;

    self.frame = frame;

}

2:设置视图某个角的圆角(这边是左下跟右下)

 [self addRoundingCorners:UIRectCornerBottomLeft | UIRectCornerBottomRight cornerRadii:CGSizeMake(, )];

 [self setClipsToBounds:YES];

- (void)addRoundingCorners:(UIRectCorner)corners cornerRadii:(CGSize)cornerRadii{

    UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:self.bounds byRoundingCorners:corners cornerRadii:cornerRadii];

    CAShapeLayer *maskLayer = [CAShapeLayer new];

    maskLayer.frame = self.bounds;

    maskLayer.path = maskPath.CGPath;

    self.layer.mask = maskLayer;

}

3:设置一个视图弹出来,可以先加载然后隐藏

if (!_inputTipsView) {

        _inputTipsView = ({

            EaseInputTipsView *tipsView = [EaseInputTipsView tipsViewWithType:EaseInputTipsViewTypeLogin];

            tipsView.valueStr = nil;

            __weak typeof(self) weakSelf = self;

            tipsView.selectedStringBlock = ^(NSString *valueStr){

                [weakSelf.view endEditing:YES];

                weakSelf.myLogin.email = valueStr;

                [weakSelf refreshIconUserImage];

                [weakSelf.myTableView reloadData];

            };

            UITableViewCell *cell = [_myTableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow: inSection:]];

            [tipsView setY:CGRectGetMaxY(cell.frame) - 0.5];

            [_myTableView addSubview:tipsView];

            tipsView;

        });

    }

注意:因为这边输入框是在列表上,所以把要弹出的视图就addSubview到其上面;

cell.textField.keyboardType = UIKeyboardTypeEmailAddress;

            [cell configWithPlaceholder:@" 电子邮箱/个性后缀" andValue:self.myLogin.email];

            cell.textValueChangedBlock = ^(NSString *valueStr){

                weakSelf.inputTipsView.valueStr = valueStr;

                weakSelf.inputTipsView.active = YES;

                weakSelf.myLogin.email = valueStr;

                [weakSelf.iconUserView setImage:[UIImage imageNamed:@"icon_user_monkey"]];

            };

这样可以通过active属性进行控制它是否显示;

子视图(其实就是一个列表,并给它设置的大小)的这个属性控制:

- (void)setActive:(BOOL)active{

    _active = active;

    self.hidden = self.dataList.count <=  || !_active;

}

 4:根据不同的内容加载跟去除视图

-(void)configUI:(BOOL)haveData
{
if (haveData) {
//有数据
if (self.curSearchImageNoDataView) {
[self.curSearchImageNoDataView removeFromSuperview];
self.curSearchImageNoDataView=nil;
} if (!_myTableView) {
_myTableView = [[UITableView alloc] initWithFrame:CGRectMake(,0.5, SCREEN_WIDTH, SCREEN_HEIGHT) style:UITableViewStylePlain];
_myTableView.backgroundColor = RGB(, , );
_myTableView.showsVerticalScrollIndicator = NO;
_myTableView.showsHorizontalScrollIndicator=NO;
_myTableView.tableHeaderView=[self addTableHeaderView];
_myTableView.tableFooterView=[self addTableFootView];
_myTableView.dataSource = self;
_myTableView.delegate = self;
_myTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
[_myTableView registerClass:[ZURoomImageCell class] forCellReuseIdentifier:NSStringFromClass([ZURoomImageCell class])];
_myTableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingTarget:self refreshingAction:@selector(loadTableData)]; [self.view addSubview:_myTableView];
[_myTableView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(UIEdgeInsetsMake(0.5, , , ));
}];
} }
else
{
//无数据
if (self.myTableView) {
[self.myTableView removeFromSuperview];
self.myTableView=nil;
} if (!self.curSearchImageNoDataView) {
self.curSearchImageNoDataView=[[ZUSearchImageNoDataView alloc]init];
[self.view addSubview:self.curSearchImageNoDataView];
[self.curSearchImageNoDataView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo();
make.left.and.right.and.bottom.mas_equalTo();
}];
} __weak typeof(self) weakSelf = self;
[self.curSearchImageNoDataView initWithHeightValue:self.rongYunName doneBlock:^{
[weakSelf addRoomImageAction];
}];
}
}

IOS客户端Coding项目记录(六)的更多相关文章

  1. IOS客户端Coding项目记录导航

    IOS客户端Coding项目记录(一) a:UITextField设置出现清除按键 b:绘画一条下划线  表格一些设置 c:可以定义表头跟底部视图(代码接上面) d:隐藏本页的导航栏 e:UIEdge ...

  2. IOS客户端Coding项目记录(四)

    1:打开Xcode,然后闪退,报加载某库出现异常 如/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolc ...

  3. IOS客户端Coding项目记录(五)

    1:统一修改导航栏的样式,在 AppDelegate.m中 - (BOOL)application:(UIApplication *)application didFinishLaunchingWit ...

  4. IOS客户端Coding项目记录(一)

    1:UITextField设置出现清除按键 self.textField.clearButtonMode = UITextFieldViewModeWhileEditing; 说明: UITextFi ...

  5. IOS客户端Coding项目记录(三)

    18:图片视图几种填充样式 _imgView.contentMode = UIViewContentModeScaleAspectFill; 如下: typedef NS_ENUM(NSInteger ...

  6. IOS客户端Coding项目记录(二)

    9:第三方插件整理 JSON转实体:jsonModel https://github.com/icanzilb/JSONModel/ 美化按键:BButton https://github.com/m ...

  7. 开源项目在真机调试(Coding iOS 客户端为例)

    一.前言 iOS 13学习系列:如何在github下载开源项目到本地(Coding iOS 客户端为例)已经把 Coding iOS 客户端源码下载到本地. 但项目进行真机调试遇到很多问题. 二.问题 ...

  8. 如何在github下载开源项目到本地(Coding iOS 客户端为例)

    一.前言 以 Coding iOS 客户端 为例讲解如何在github下载开源项目到本地 github地址:https://github.com/Coding/Coding-iOS 二.分析 根据项目 ...

  9. “快的打车”创始人陈伟星的新项目招人啦,高薪急招Java服务端/Android/Ios 客户端研发工程师/ mysql DBA/ app市场推广专家,欢迎大家加入我们的团队! - V2EX

    "快的打车"创始人陈伟星的新项目招人啦,高薪急招Java服务端/Android/Ios 客户端研发工程师/ mysql DBA/ app市场推广专家,欢迎大家加入我们的团队! - ...

随机推荐

  1. 百度Map与HT for Web结合的GIS网络拓扑应用

    在<HT for Web整合OpenLayers实现GIS地图应用>篇中介绍了HT for Web与OpenLayers的整合,不少朋友反应国内用得比较多的还是百度地图,虽然HT整合百度地 ...

  2. 重构:用Command替换条件调度程序

    注:该随笔受启发于 <重构与模式>  第七章 第7.6小节 用Command替换条件调度程序 . 对于Command不做过多解释,这里我找了两个例子.供部分园友参阅:Command例子1  ...

  3. HTML的checkbox和radio的美化

    checkbox和radio的美化 checkbox: <style type="text/css"> input[type="checkbox"] ...

  4. asp.net MVC4的执行流程

    MVC在底层和传统的asp.net是一致的,在底层之上,相关流程如下: 1)Global.asax里,MvcApplication对象的Application_Start()事件中,调用 RouteC ...

  5. 应用Css美化表单

    原来的效果  美化之后的效果  实现代码 <style> .container { margin:0auto; width:620px; } fieldset { padding:18px ...

  6. ASP.NET MVC 网站开发总结(六)——简谈Json的序列化与反序列化

    首先,先简单的谈一下什么是序列化与反序列化,序列化 (Serialization)将对象的状态信息转换为可以存储或传输的形式的过程.在序列化期间,对象将其当前状态写入到临时或持久性存储区.以后,可以通 ...

  7. C#项目中常用到的设计模式

    1. 引言 一个项目的通常都是从Demo开始,不断为项目添加新的功能以及重构,也许刚开始的时候代码显得非常凌乱,毫无设计可言.但是随着项目的迭代,往往需要将很多相同功能的代码抽取出来,这也是设计模式的 ...

  8. 实现在Android 下log的使用总结

    一:在源码开发模式下 1:包含头文件: #include <cutils/log.h>   2:定义宏LOG_TAG #define LOG_TAG "MY LOG TAG&qu ...

  9. JDBC增删改查和查唯一的完整代码

    第一部分代码(实体类) package com.wf.entity; public class Hehe{ private int hehe_id; private String hehe_name; ...

  10. 2016年湖南省第十二届大学生计算机程序设计竞赛---Parenthesis(线段树求区间最值)

    原题链接 http://acm.csu.edu.cn/OnlineJudge/problem.php?id=1809 Description Bobo has a balanced parenthes ...