- 简单实现浮动按钮+上滑隐藏按钮+下滑显示按钮
AlanGe
#import"SlideShowOrHideVC.h"@interfaceSlideShowOrHideVC(){CGFloatlastContentOffset;BOOLhideBtn;BOOLisBottom;}@property(nonatomic,strong)UITableView*tableView;@property(nonatomic,strong)UIButton*myButt
- Masonry实现简单动画
编程_书恨少
1.安装Masonry库pod'Masonry'2.导入Masonryimport3.使用-(void)viewDidLoad{[superviewDidLoad];UIButton*btn=[[UIButtonalloc]init];btn.backgroundColor=[UIColorredColor];[self.viewaddSubview:btn];[btnaddTarget:self
- iOS 改变左右侧距离
王家小雷
(void)initNavBar{UIButton*addBtn=[[UIButtonalloc]initWithFrame:CGRectMake(0,0,24,24)];[addBtnsetImage:[UIImageimageNamed:@"NewBack"]forState:UIControlStateNormal];[addBtnsetContentHorizontalAlignment:
- Unity中,C#的事件与委托区别和经典实例
极致人生-010
unityc#游戏引擎
文章目录实例1:委托(Delegate)的基本用法实例2:事件(Event)的声明与订阅实例3:Unity引擎中的委托实例-UIButton.onClick实例4:事件(Event)的安全性实例5:事件处理器链(MulticastDelegate)在Unity中,C#的事件处理与委托密切相关。下面通过5个实例来详细阐述它们的区别和使用场景:实例1:委托(Delegate)的基本用法publicde
- iOS 自定义按钮:按钮标题的分行处理,单选处理
嗯嗯大葱
按钮属于iOS中的一个基本控件.项目中的各种需求也是对我们灵活使用各种控件的考验.这次我遇到了一种按钮布局如图:给需要的同志们一个思路.也可以用我的代码,我会贴出来解决方法在下面类似与这种设计,可以有三种放发去实现:第一种:全部让UI切图,选中状态,和非选中切两套图,用UIButton的选中和非选中特性去做.这种不太灵活,每次按钮的个数增加,都要重新处理界面.第二种:用view去做,封装一个Vie
- 点击不同按钮切换不同按钮刷新数据
summerTa
-(void)orderButtonClick:(UIButton*)btn{self.selectedButton.enabled=YES;btn.enabled=NO;self.selectedButton=btn;self.selectBtnTag=btn.tag;switch(btn.tag){case0:NSLog(@"默认距离");_strOrderType=@"default";br
- JPGradient:可设置渐变背景色、文字色的控件(包括 UIView、UILabel、UIButton)
健了个平_24
Demo使用letgLabel:GradientLabel={letlabel=GradientLabel(frame:CGRect(x:50,y:100,width:300,height:100))returnlabel}()letgBtn:GradientButton={letbtn=GradientButton(type:.system)btn.frame=CGRect(x:50,y:200
- unity 点击事件
AI视觉网奇
unityunity游戏引擎
目录点击按钮,显示图片功能教程第1步添加uibutton,添加uiRawImage第2步添加脚本:第3步,把脚本拖拽到button,点击button,设置脚本的变量,GameObject添加Component组件点击按钮,显示图片功能教程第1步添加uibutton,添加uiRawImage第2步添加脚本:usingSystem;usingSystem.Collections;usingSystem
- iOS 导航栏自定义view
屈涯
self.automaticallyAdjustsScrollViewInsets=YES;YHEatTitleView*titleView=[YHEatTitleViewcreateCustomNav:^(UIButton*sender){[self.navigationControllerpopViewControllerAnimated:YES];}];[titleView.navTitle
- iOS开发:浅谈响应链与事件传递
MiniCoder
基本概念响应者:在iOS中,响应者为能响应事件的UIResponder子类对象,如UIButton、UIView等。响应链:响应链是由链接在一起的响应者(UIResponse子类)组成的。默认情况下,响应链是由第一响应者,到application对象以及中间所有响应者一起组成的。事件传递:获得响应链后,将事件由第一响应者往application传递的过程即为事件传递。14477290-74a39a
- 防止暴力点击
Iamyu
一、.使用runtime解决创建按钮的分类.声明文件(.h)#definedefaultInterval.5//默认时间间隔@interfaceUIButton(UIbutton_Delay)@property(nonatomic,assign)NSTimeIntervaltimeInterval;//用这个给重复点击加间隔@property(nonatomic,assign)BOOLisIgno
- 主线程阻塞问题
愤怒小鸟飞呀飞
问题主线程阻塞会导致新添加在父视图的view不能及时显示。如下代码:-(void)saveButtonAction:(UIButton*)button{[SVProgressHUDshowWithStatus:@"保存中。。。"maskType:SVProgressHUDMaskTypeClear];intm=0;while(m<100){m++;NSLog(@"test");}}上述代码中,SV
- SDWebImage前世今生之V2.4版本
_相信自己_
2.4版本2011年10月1日发布1.类结构新增了两个类UIButton+WebCache设置ButtonImage//------------------------------2.4版本更新-功能扩展-------------------------@interfaceUIButton(WebCache)-(void)setImageWithURL:(NSURL*)url;-(void)set
- UIScrollView和UIButton的联动菜单
海笙樾
主体框架是UIScrollView,子视图是Controller,Button链接如下GitHub-1023678795/ScrollAndCollection
- object-c一些基础内容--简单整理版
小白不想秃头
c语言ios开发语言objective
#import@interfaceViewController()@property(strong,nonatomic)UIImageView*imageView;@property(strong,nonatomic)UIButton*cameraButton;@end@implementationViewController-(void)viewDidLoad{[superviewDidLoad
- UIButton+ZXSImageTitleSpacing
CoderZXS
////UIButton+ZXSImageTitleSpacing.h//////CreatedbyCoderZXSon2016/4/12.//Copyright©2016年CoderZXS.Allrightsreserved.//#import//定义一个枚举(包含了四种类型的button)typedefNS_ENUM(NSUInteger,ZXSButtonEdgeInsetsStyle){Z
- swift 中 Lazy,deinit用法
a浮生若梦a
*swift中懒加载写法,懒加载在Swift中是一个闭包。懒加载详细介绍看这里//第一种方式简单创建lazyvarbutton=UIButton()//第二种方式可以设置更多的属性lazyvarbutton:UIButton={letbutton=UIButton()button.setTitle("按钮",for:.normal)returnbutton}()*OC中的dealloc方法,在Sw
- 将自定义cell变成弱引用
summerTa
__weaktypeof(self)wkSelf=self;__weaktypeof(upViewCell)wkCell=upViewCell;upViewCell.zuoShanBack=^(UIButton*btn){[wkCellcloseMenuWithCompletionHandle:^{NSMutableDictionary*params=[NSMutableDictionarydic
- element-ui button 组件源码分享
jqh_0484
ui
element-uibutton源码分享,基于对源码的理解,编写一个简单的demo,主要分三个模块来分享:一、button组件的方法。1.1在方法这块,button组件内部通过暴露click方法实现,具体如下:二、button组件的计算属性。2.1button组件当中使用的三个计算属性如下:三、button组件的属性。通过官网我们知道button有size、type、plain、round、cir
- iOS UIButton 点击无响应的解决办法
CoderLGL
按钮不响应的原因按钮添加到了一个没有开启用户交互的父View上,例如UIImageView,这时候开启父试图的交互view.userInteractionEnabled=YES设为YES就可以解决问题按钮自身被遮挡,点击的时候根本就没有点击到button,而是他上面一层View,自然就不会响应,使用xcode看图层的方法,可以清晰看出.按钮的frame超出了父视图的frame,这个是最容易出现的,
- iOS开发笔记-113:兼容ios14
原味蛋炒饭
1:iOS14中UITableViewCell如果子控件是加到cell上的会被cell的contentView所遮挡,contentView会在最上层。所以按钮UIbutton之类的要加在contentView上2:刘海屏statusBarFrame.size.height由44变成了48
- UIButton文字在左边图片在右边
羊妞麻麻
https://blog.csdn.net/hierarch_lee/article/details/50816354
- UIButton渲染色蓝色的问题
iOS_Developer
[UIButtonbuttonWithType:UIButtonTypeSystem]会默认带渲染色使用[UIButtonbuttonWithType:UIButtonTypeCustom]方法创建不带渲染色
- iOS 创建UIButton的增加分类扩大按钮的点击区域
匠心慢行
前言:在实际开发中会遇到一些页面由于设计给出的按钮尺寸很小导致这个按钮很难点击(尤其是手指胖的朋友),比如顶部返回按钮、cell里面的操作按钮、勾选协议时候的选中按钮等场景。这时候就需要适当的扩大按钮的点击范围来解决这个问题。思路:可以给button创建一个分类,创建一个公共方法,这个方法可以通过参数和关键字使用objc_setAssociatedObject将传入扩大的范围存起来,当用户触碰屏幕
- swift BUtton调整左右subView的间距
LiYaoPeng
extensionUIButton{funcsetSubViewPosition(imageanImage:UIImage?=nil,title:String?=nil,titlePosition:UIViewContentMode,additionalSpacing:CGFloat,state:UIControlState){self.imageView?.contentMode=.center
- 关于 iOS UIButton执行动画后点击按钮无法响应事件的问题.
月夜芳华
因为业务需求需要写一个按钮旋转放大然后移动到指定位置的需求.然后顺势很快将动画给动画搞定了.但是随之而来的遇到了两个问题(如下):1.动画执行完后立马回到了原始位置.解决方法(组动画):CAAnimationGroup*groupAnimation=[CAAnimationGroupanimation];groupAnimation.removedOnCompletion=NO;groupAnim
- iOS 使用touchBegan隐藏键盘后,UIButton和UITableView上的点击事件不响应
wangxiao001
隐藏键盘操作,是开发中常见操作。一般,我们可以通过下面的方式,来隐藏键盘。隐藏键盘的处理逻辑如下:-(void)viewDidLoad{-(void)touchesBegan{[superviewDidLoad];。。。。。。。。。。UITapGestureRecognizer*tap=[[UITapGestureRecognizeralloc]initWithTarget:selfaction:
- 2021-12-21 Category UIButton 图片和文字位置
两米长的大白菜
#import/*针对同时设置了Image和Title的场景时UIButton中的图片和文字的关系*/typedefNS_ENUM(NSInteger,ButtonImageTitleStyle){ButtonImageTitleStyleDefault=0,//图片在左,文字在右,整体居中。ButtonImageTitleStyleLeft=0,//图片在左,文字在右,整体居中。ButtonIm
- 4.UIBarItem
二斤寂寞
UIBaritem可以添加到显示在屏幕底部的栏中的项目的抽象超类。栏上的项目的行为类似于按钮(UIButton)的行为。它们具有标题,图像,动作和目标。还可以启用和禁用栏上的项目。classUIBarItem:NSObject//常用属性//设置是否可用,默认为YESbatItem.enabled=YES;//设置模型文字属性,默认为nilbatItem.title=@"UIBarItem";//
- iOS开发:浅谈响应链与事件传递
恍然如梦_b700
基本概念响应者:在iOS中,响应者为能响应事件的UIResponder子类对象,如UIButton、UIView等。响应链:响应链是由链接在一起的响应者(UIResponse子类)组成的。默认情况下,响应链是由第一响应者,到application对象以及中间所有响应者一起组成的。事件传递:获得响应链后,将事件由第一响应者往application传递的过程即为事件传递。响应链响应者链执行的过程1、寻
- java短路运算符和逻辑运算符的区别
3213213333332132
java基础
/*
* 逻辑运算符——不论是什么条件都要执行左右两边代码
* 短路运算符——我认为在底层就是利用物理电路的“并联”和“串联”实现的
* 原理很简单,并联电路代表短路或(||),串联电路代表短路与(&&)。
*
* 并联电路两个开关只要有一个开关闭合,电路就会通。
* 类似于短路或(||),只要有其中一个为true(开关闭合)是
- Java异常那些不得不说的事
白糖_
javaexception
一、在finally块中做数据回收操作
比如数据库连接都是很宝贵的,所以最好在finally中关闭连接。
JDBCAgent jdbc = new JDBCAgent();
try{
jdbc.excute("select * from ctp_log");
}catch(SQLException e){
...
}finally{
jdbc.close();
- utf-8与utf-8(无BOM)的区别
dcj3sjt126com
PHP
BOM——Byte Order Mark,就是字节序标记 在UCS 编码中有一个叫做"ZERO WIDTH NO-BREAK SPACE"的字符,它的编码是FEFF。而FFFE在UCS中是不存在的字符,所以不应该出现在实际传输中。UCS规范建议我们在传输字节流前,先传输 字符"ZERO WIDTH NO-BREAK SPACE"。这样如
- JAVA Annotation之定义篇
周凡杨
java注解annotation入门注释
Annotation: 译为注释或注解
An annotation, in the Java computer programming language, is a form of syntactic metadata that can be added to Java source code. Classes, methods, variables, pa
- tomcat的多域名、虚拟主机配置
g21121
tomcat
众所周知apache可以配置多域名和虚拟主机,而且配置起来比较简单,但是项目用到的是tomcat,配来配去总是不成功。查了些资料才总算可以,下面就跟大家分享下经验。
很多朋友搜索的内容基本是告诉我们这么配置:
在Engine标签下增面积Host标签,如下:
<Host name="www.site1.com" appBase="webapps"
- Linux SSH 错误解析(Capistrano 的cap 访问错误 Permission )
510888780
linuxcapistrano
1.ssh -v
[email protected] 出现
Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).
错误
运行状况如下:
OpenSSH_5.3p1, OpenSSL 1.0.1e-fips 11 Feb 2013
debug1: Reading configuratio
- log4j的用法
Harry642
javalog4j
一、前言: log4j 是一个开放源码项目,是广泛使用的以Java编写的日志记录包。由于log4j出色的表现, 当时在log4j完成时,log4j开发组织曾建议sun在jdk1.4中用log4j取代jdk1.4 的日志工具类,但当时jdk1.4已接近完成,所以sun拒绝使用log4j,当在java开发中
- mysql、sqlserver、oracle分页,java分页统一接口实现
aijuans
oraclejave
定义:pageStart 起始页,pageEnd 终止页,pageSize页面容量
oracle分页:
select * from ( select mytable.*,rownum num from (实际传的SQL) where rownum<=pageEnd) where num>=pageStart
sqlServer分页:
 
- Hessian 简单例子
antlove
javaWebservicehessian
hello.hessian.MyCar.java
package hessian.pojo;
import java.io.Serializable;
public class MyCar implements Serializable {
private static final long serialVersionUID = 473690540190845543
- 数据库对象的同义词和序列
百合不是茶
sql序列同义词ORACLE权限
回顾简单的数据库权限等命令;
解锁用户和锁定用户
alter user scott account lock/unlock;
//system下查看系统中的用户
select * dba_users;
//创建用户名和密码
create user wj identified by wj;
identified by
//授予连接权和建表权
grant connect to
- 使用Powermock和mockito测试静态方法
bijian1013
持续集成单元测试mockitoPowermock
实例:
package com.bijian.study;
import static org.junit.Assert.assertEquals;
import java.io.IOException;
import org.junit.Before;
import org.junit.Test;
import or
- 精通Oracle10编程SQL(6)访问ORACLE
bijian1013
oracle数据库plsql
/*
*访问ORACLE
*/
--检索单行数据
--使用标量变量接收数据
DECLARE
v_ename emp.ename%TYPE;
v_sal emp.sal%TYPE;
BEGIN
select ename,sal into v_ename,v_sal
from emp where empno=&no;
dbms_output.pu
- 【Nginx四】Nginx作为HTTP负载均衡服务器
bit1129
nginx
Nginx的另一个常用的功能是作为负载均衡服务器。一个典型的web应用系统,通过负载均衡服务器,可以使得应用有多台后端服务器来响应客户端的请求。一个应用配置多台后端服务器,可以带来很多好处:
负载均衡的好处
增加可用资源
增加吞吐量
加快响应速度,降低延时
出错的重试验机制
Nginx主要支持三种均衡算法:
round-robin
l
- jquery-validation备忘
白糖_
jquerycssF#Firebug
留点学习jquery validation总结的代码:
function checkForm(){
validator = $("#commentForm").validate({// #formId为需要进行验证的表单ID
errorElement :"span",// 使用"div"标签标记错误, 默认:&
- solr限制admin界面访问(端口限制和http授权限制)
ronin47
限定Ip访问
solr的管理界面可以帮助我们做很多事情,但是把solr程序放到公网之后就要限制对admin的访问了。
可以通过tomcat的http基本授权来做限制,也可以通过iptables防火墙来限制。
我们先看如何通过tomcat配置http授权限制。
第一步: 在tomcat的conf/tomcat-users.xml文件中添加管理用户,比如:
<userusername="ad
- 多线程-用JAVA写一个多线程程序,写四个线程,其中二个对一个变量加1,另外二个对一个变量减1
bylijinnan
java多线程
public class IncDecThread {
private int j=10;
/*
* 题目:用JAVA写一个多线程程序,写四个线程,其中二个对一个变量加1,另外二个对一个变量减1
* 两个问题:
* 1、线程同步--synchronized
* 2、线程之间如何共享同一个j变量--内部类
*/
public static
- 买房历程
cfyme
2015-06-21: 万科未来城,看房子
2015-06-26: 办理贷款手续,贷款73万,贷款利率5.65=5.3675
2015-06-27: 房子首付,签完合同
2015-06-28,央行宣布降息 0.25,就2天的时间差啊,没赶上。
首付,老婆找他的小姐妹接了5万,另外几个朋友借了1-
- [军事与科技]制造大型太空战舰的前奏
comsci
制造
天气热了........空调和电扇要准备好..........
最近,世界形势日趋复杂化,战争的阴影开始覆盖全世界..........
所以,我们不得不关
- dateformat
dai_lm
DateFormat
"Symbol Meaning Presentation Ex."
"------ ------- ------------ ----"
"G era designator (Text) AD"
"y year
- Hadoop如何实现关联计算
datamachine
mapreducehadoop关联计算
选择Hadoop,低成本和高扩展性是主要原因,但但它的开发效率实在无法让人满意。
以关联计算为例。
假设:HDFS上有2个文件,分别是客户信息和订单信息,customerID是它们之间的关联字段。如何进行关联计算,以便将客户名称添加到订单列表中?
&nbs
- 用户模型中修改用户信息时,密码是如何处理的
dcj3sjt126com
yii
当我添加或修改用户记录的时候对于处理确认密码我遇到了一些麻烦,所有我想分享一下我是怎么处理的。
场景是使用的基本的那些(系统自带),你需要有一个数据表(user)并且表中有一个密码字段(password),它使用 sha1、md5或其他加密方式加密用户密码。
面是它的工作流程: 当创建用户的时候密码需要加密并且保存,但当修改用户记录时如果使用同样的场景我们最终就会把用户加密过的密码再次加密,这
- 中文 iOS/Mac 开发博客列表
dcj3sjt126com
Blog
本博客列表会不断更新维护,如果有推荐的博客,请到此处提交博客信息。
本博客列表涉及的文章内容支持 定制化Google搜索,特别感谢 JeOam 提供并帮助更新。
本博客列表也提供同步更新的OPML文件(下载OPML文件),可供导入到例如feedly等第三方定阅工具中,特别感谢 lcepy 提供自动转换脚本。这里有导入教程。
- js去除空格,去除左右两端的空格
蕃薯耀
去除左右两端的空格js去掉所有空格js去除空格
js去除空格,去除左右两端的空格
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>&g
- SpringMVC4零配置--web.xml
hanqunfeng
springmvc4
servlet3.0+规范后,允许servlet,filter,listener不必声明在web.xml中,而是以硬编码的方式存在,实现容器的零配置。
ServletContainerInitializer:启动容器时负责加载相关配置
package javax.servlet;
import java.util.Set;
public interface ServletContainer
- 《开源框架那些事儿21》:巧借力与借巧力
j2eetop
框架UI
同样做前端UI,为什么有人花了一点力气,就可以做好?而有的人费尽全力,仍然错误百出?我们可以先看看几个故事。
故事1:巧借力,乌鸦也可以吃核桃
有一个盛产核桃的村子,每年秋末冬初,成群的乌鸦总会来到这里,到果园里捡拾那些被果农们遗落的核桃。
核桃仁虽然美味,但是外壳那么坚硬,乌鸦怎么才能吃到呢?原来乌鸦先把核桃叼起,然后飞到高高的树枝上,再将核桃摔下去,核桃落到坚硬的地面上,被撞破了,于是,
- JQuery EasyUI 验证扩展
可怜的猫
jqueryeasyui验证
最近项目中用到了前端框架-- EasyUI,在做校验的时候会涉及到很多需要自定义的内容,现把常用的验证方式总结出来,留待后用。
以下内容只需要在公用js中添加即可。
使用类似于如下:
<input class="easyui-textbox" name="mobile" id="mobile&
- 架构师之httpurlconnection----------读取和发送(流读取效率通用类)
nannan408
1.前言.
如题.
2.代码.
/*
* Copyright (c) 2015, S.F. Express Inc. All rights reserved.
*/
package com.test.test.test.send;
import java.io.IOException;
import java.io.InputStream
- Jquery性能优化
r361251
JavaScriptjquery
一、注意定义jQuery变量的时候添加var关键字
这个不仅仅是jQuery,所有javascript开发过程中,都需要注意,请一定不要定义成如下:
$loading = $('#loading'); //这个是全局定义,不知道哪里位置倒霉引用了相同的变量名,就会郁闷至死的
二、请使用一个var来定义变量
如果你使用多个变量的话,请如下方式定义:
. 代码如下:
var page
- 在eclipse项目中使用maven管理依赖
tjj006
eclipsemaven
概览:
如何导入maven项目至eclipse中
建立自有Maven Java类库服务器
建立符合maven代码库标准的自定义类库
Maven在管理Java类库方面有巨大的优势,像白衣所说就是非常“环保”。
我们平时用IDE开发都是把所需要的类库一股脑的全丢到项目目录下,然后全部添加到ide的构建路径中,如果用了SVN/CVS,这样会很容易就 把
- 中国天气网省市级联页面
x125858805
级联
1、页面及级联js
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
&l