- iOS-UIButton设置高亮状态下的背景色
Simple_Code
UIButton一般分为高亮的普通两种状态,原生的方法可以设置这两种不同状态下的文字颜色,文字内容,背景图片,按钮图片。但是不能设置按钮的背景色。方法一:通过按钮的事件来设置背景色-(void)viewDidLoad{[superviewDidLoad];UIButton*button1=[[UIButtonalloc]initWithFrame:CGRectMake(50,200,100,50)
- iOS-UIButton按钮左文右图/上图下文/图文居左/图文具有/按钮样式大全
冻结的转身
按钮样式大全.png随着做过的项目越来越多,发现很多iOS控件的基础属性越来越不能满足实际开发需求了,今天总结一下UIButton的几个不常用但缺很有必要的属性。一、默认的按钮样式默认的图文共存按钮.png这是我们简单常用的按钮样式,在此不再多做介绍。二、左文右图按钮左文右图按钮.png左文右图也是开发过程中常见的一种按钮样式。代码实现方式如下:[buttonsetTitleEdgeInsets:
- iOS-UIButton、UILabel等自定义文字位置
Bc_wh1te_Le1
有些时候我们想让UIButton的title居左对齐,我们设置btn.textLabel.textAlignment=UITextAlignmentLeft是没有作用的,我们需要设置btn.contentHorizontalAlignment=UIControlContentHorizonAlignmentLeft;但是问题又出来,此时文字会紧贴到做边框,我们可以设置btn.contentEdge
- iOS-UIButton
亦晴工作室
viewWithTag//根据tag取得子视图手势.viewsuperView/取得按钮的背景图片UIImage*image=[nextButtonbackgroundImageForState:UIControlStateNormal];UIButton的演示,按钮//1.创建和显示//文本按钮UIButtonTypeSystem//图片按钮UIButtonTypeCustom//系统预定义的按
- IOS-UIButton使用
DaveZ
一、IOSUIButton的基本属性//创建一个Button对象,根据类型来创建button//圆角类型button:UIButtonTypeRoundedRect//通过类方法来创建buttonWithType:类名+方法名,不能通过allocinit方式创建UIButton*button=[UIButtonbuttonWithType:UIButtonTypeRoundedRect];butt
- UIEdgeInsets设置button上的文字和图片上下垂直居中对齐
武一顶顶
iOS-UIButton(UIEdgeInsets)/设置button上的文字和图片上下垂直居中对齐UIEdgeInsets[objc]typedefstructUIEdgeInsets{CGFloattop,left,bottom,right;//specifyamounttoinset(positive)foreachoftheedges.valuescanbenegativeto'outse
- IOS-UIButton的文本与图片的布局
影子戏法
设置文本和图片的布局http://www.cnblogs.com/oc-bowen/p/5851849.html简单的js调用OChttp://blog.csdn.net/hj7jay/article/details/51798928字体设置http://blog.csdn.net/csdnAaron/article/details/48370549UIScrollView停止滑动减速http:/
- iOS-UIButton核心属性
Swift从入门到崩溃
UIBtton-自定制按钮在系统的按钮中,我门可以给按钮添加背景图片,文字的属性,但在现实中我们会见到很多上面是图片下面是按钮的按钮,队员这样的按钮我们通过系统的按钮是无法创建出来的。这时我们就必须对系统的按钮方法进行重写,来自定制我们自己的按钮。1.自定制按钮既然要重写系统按钮的方法,这里我们新创建一个class让它继承UIButton然后在这个class重写方法,实现按钮的自定制。具体步骤如下
- iOS-UIbutton无法替换监听方法另辟他径
暖游丶
示范:方法1:[self.UploadexamineaddTarget:selfaction:@selector(btnlinkS:)forControlEvents:UIControlEventTouchUpInside];方法2:[self.UploadexamineaddTarget:selfaction:@selector(btnlinkTwo:)forControlEvents:UICo
- ios-uibutton按钮加阴影
sunfire
1、按钮加弧度和阴影//登录按钮加阴影//self.loginBtn.layer.masksToBounds=YES;//当有阴影时,不能为YESself.loginBtn.layer.cornerRadius=4;//圆角弧度self.loginBtn.layer.shadowOffset=CGSizeMake(0,4);//阴影的偏移量self.loginBtn.layer.shadowOpa
- Runtime—实战篇
lionsom_lin
目录:Runtime简介runtime实战应用代码一:OC代码对象调用代码->消息发送机制代码的转换代码二:验证OC底层实现代码三:Runtime项目中的实用代码四:归档解档代码五:用runtime解耦取消依赖代码六:利用runtime一键改变字体代码七:用runtime-关联对象,使用Category添加属性代码八:利用Runtime减少应用崩溃-例如数组越界代码九:iOS-UIButton同时
- iOS-UIButton倒计时
安处幽篁兮
一般倒计时的使用场景就两种:发送短信验证码倒计时广告页倒计时一、发送短信验证码倒计时这种情况下,正在倒计时的按钮是不可点击的,也就是说是不可交互的。二、广告页倒计时广告页一般都会有个跳过,那么这个倒计时按钮是可点击可交互的。在倒计时结束时,我们还想让其进入首页于是乎,就有了下面的分类@implementationUIButton(CountDown)/**倒计时@paramtimeLine倒计时时
- iOS-UIButton 全面解析
xx_cc
UIButton的全面解析建议收藏,用到的时候来这里一查就都明白了//初始化Button不用allocainit的方法用便利构造器初始化UIButton*button=[UIButtonbuttonWithType:UIButtonTypeSystem];typedefNS_ENUM(NSInteger,UIButtonType){UIButtonTypeCustom=0,-自定义风格UIButt
- iOS-UIButton UITextField设置圆角的方法
woooooo
UIButtonUITextField等继承与UIView的控件可以使用该方法设置圆角self.button.layer.cornerRadius=3.0f;self.button.clipsToBounds=YES;//self.button.maskToBounds=YES;/*clipsToBounds是指视图上的子视图,如果超出父视图的部分就截取掉,masksToBounds却是指视图的图
- 记录-查找
廖城述
ios基础UI1.1,iOSLabel详解学习_OChttp://www.jianshu.com/p/b294f385e07b1.2,iOS-UIButton按钮http://www.jianshu.com/p/cc9655d820451.3,UITextView的常用属性http://www.jianshu.com/p/22ba60a34c1c1.4iOSUISwitch开关http://www
- iOS-UIButton
我是谁重要吗
继承关系:inheritsfrom:UIControl:UIView:UIResponder:NSObjectUIButton其实包含UIImageView和UILabel两个控件,UIButton继承于UIControl,所以有addtarget监听事件1、类型://初始化一个按钮对象////////通过类方法来创建buttonWithType:类名+方法名//内存自己管理不能通过allocai
- iOS-UIButton防止重复点击(三种办法)
路飞_Luck
目录使用场景方法一设置enabled或userInteractionEnabled属性方法二借助cancelPreviousPerformRequestsWithTarget:selector:object实现方法三通过runtime交换方法实现注意事项一使用场景在实际应用场景中,有几个业务场景需要控制UIButton响应事件的时间间隔。1当点击按钮来执行网络请求时,若请求耗时稍长,用户往往会多次
- iOS-UIButton简单的使用介绍
FateYin_
iOS开发
1.最简单的一个创建方式UIButton*btn=[[UIButtonalloc]init];2.常用创建方式,在创建button的同时设置typeUIButton*btn1=[UIButtonbuttonWithType:UIButtonTypeCustom];3.设置button的文字在使用中需要注意title的默认颜色是无色的接下来需要设置下title的颜色参数一:文字参数二:Button的
- iOS-UIButton的基本使用
qq_36357670
iOS
一、UIButton的基本设置//初始化按钮UIButton*button=[UIButtonbuttonWithType:UIButtonTypeCustom];//UIButton*button=[[UIButtonalloc]initWithFrame:CGRectMake(100,100,120,50)];//按钮类型typedefNS_ENUM(NSInteger,UIButtonTyp
- iOS-UIButton 全面解析
xiao小马哥
02.jpg字数1443阅读548评论5喜欢36UIButton的全面解析建议收藏,用到的时候来这里一查就都明白了初始化Button不用allocainit的方法用便利构造器初始化UIButton*button=[UIButtonbuttonWithType:UIButtonTypeSystem];typedefNS_ENUM(NSInteger,UIButtonType){UIButtonTyp
- Swift开发IOS-UIButton
tianmaxingkong_
UIButton继承自UIControl,在xib文件中创建UIButton:利用代码在swift文件中添加UIButton的方式如下:UIButton常用到的属性如下:[注意]UIButton的addTarget方法的第二个参数Selector参数传入有两种方式:传递触摸对象/不传递触摸对象最后,在viewDidLoad()中将UIButton对象添加到当前view中:
- iOS-UIButton和UIImageView的区别
BaiHuaXiu123
iOS-UI
相同点:都能显示图片不同点1)UIButton在默认状况下就能监听点击事件,而UIImageView默认情况下不能。2)UIButton可以在不同状态下显示不同的图片3)UIButton既能显示文字,又能显示图片(能显示2张图片backgroundimage和image)如何选择1)UIButtonUIImageView:仅仅需要显示图片,点击图片后不需要做任何事情2)需要显示图片,点击图片后需要
- iOS - UIButton(UIEdgeInsets)/设置button上的文字和图片 在定义位置
stephen830
iOS-UIButton(UIEdgeInsets)/设置button上的文字和图片在定义位置转载自http://blog.csdn.net/wsk_123_123/article/details/18797549 UIEdgeInsetstypedefstructUIEdgeInsets{ CGFloattop,left,bottom,right; //specifyamounttoins
- ios-UIButton
DJ萧云
IOS-UI控件
(1)UIButton的创建//UIButtonTypeCustom=0,自定义风格//UIButtonTypeRoundedRect,圆角矩形//UIButtonTypeDetailDisclosure,蓝色小箭头按钮,主要做详细说明用//UIButtonTypeInfoLight,亮色感叹号//UIButtonTypeInfoDark,暗色感叹号UIButton*button=[UIButto
- Java开发中,spring mvc 的线程怎么调用?
小麦麦子
springmvc
今天逛知乎,看到最近很多人都在问spring mvc 的线程http://www.maiziedu.com/course/java/ 的启动问题,觉得挺有意思的,那哥们儿问的也听仔细,下面的回答也很详尽,分享出来,希望遇对遇到类似问题的Java开发程序猿有所帮助。
问题:
在用spring mvc架构的网站上,设一线程在虚拟机启动时运行,线程里有一全局
- maven依赖范围
bitcarter
maven
1.test 测试的时候才会依赖,编译和打包不依赖,如junit不被打包
2.compile 只有编译和打包时才会依赖
3.provided 编译和测试的时候依赖,打包不依赖,如:tomcat的一些公用jar包
4.runtime 运行时依赖,编译不依赖
5.默认compile
依赖范围compile是支持传递的,test不支持传递
1.传递的意思是项目A,引用
- Jaxb org.xml.sax.saxparseexception : premature end of file
darrenzhu
xmlprematureJAXB
如果在使用JAXB把xml文件unmarshal成vo(XSD自动生成的vo)时碰到如下错误:
org.xml.sax.saxparseexception : premature end of file
很有可能时你直接读取文件为inputstream,然后将inputstream作为构建unmarshal需要的source参数。InputSource inputSource = new In
- CSS Specificity
周凡杨
html权重Specificitycss
有时候对于页面元素设置了样式,可为什么页面的显示没有匹配上呢? because specificity
CSS 的选择符是有权重的,当不同的选择符的样式设置有冲突时,浏览器会采用权重高的选择符设置的样式。
规则:
HTML标签的权重是1
Class 的权重是10
Id 的权重是100
- java与servlet
g21121
servlet
servlet 搞java web开发的人一定不会陌生,而且大家还会时常用到它。
下面是java官方网站上对servlet的介绍: java官网对于servlet的解释 写道
Java Servlet Technology Overview Servlets are the Java platform technology of choice for extending and enha
- eclipse中安装maven插件
510888780
eclipsemaven
1.首先去官网下载 Maven:
http://www.apache.org/dyn/closer.cgi/maven/binaries/apache-maven-3.2.3-bin.tar.gz
下载完成之后将其解压,
我将解压后的文件夹:apache-maven-3.2.3,
并将它放在 D:\tools目录下,
即 maven 最终的路径是:D:\tools\apache-mave
- jpa@OneToOne关联关系
布衣凌宇
jpa
Nruser里的pruserid关联到Pruser的主键id,实现对一个表的增删改,另一个表的数据随之增删改。
Nruser实体类
//*****************************************************************
@Entity
@Table(name="nruser")
@DynamicInsert @Dynam
- 我的spring学习笔记11-Spring中关于声明式事务的配置
aijuans
spring事务配置
这两天学到事务管理这一块,结合到之前的terasoluna框架,觉得书本上讲的还是简单阿。我就把我从书本上学到的再结合实际的项目以及网上看到的一些内容,对声明式事务管理做个整理吧。我看得Spring in Action第二版中只提到了用TransactionProxyFactoryBean和<tx:advice/>,定义注释驱动这三种,我承认后两种的内容很好,很强大。但是实际的项目当中
- java 动态代理简单实现
antlove
javahandlerproxydynamicservice
dynamicproxy.service.HelloService
package dynamicproxy.service;
public interface HelloService {
public void sayHello();
}
dynamicproxy.service.impl.HelloServiceImpl
package dynamicp
- JDBC连接数据库
百合不是茶
JDBC编程JAVA操作oracle数据库
如果我们要想连接oracle公司的数据库,就要首先下载oralce公司的驱动程序,将这个驱动程序的jar包导入到我们工程中;
JDBC链接数据库的代码和固定写法;
1,加载oracle数据库的驱动;
&nb
- 单例模式中的多线程分析
bijian1013
javathread多线程java多线程
谈到单例模式,我们立马会想到饿汉式和懒汉式加载,所谓饿汉式就是在创建类时就创建好了实例,懒汉式在获取实例时才去创建实例,即延迟加载。
饿汉式:
package com.bijian.study;
public class Singleton {
private Singleton() {
}
// 注意这是private 只供内部调用
private static
- javascript读取和修改原型特别需要注意原型的读写不具有对等性
bijian1013
JavaScriptprototype
对于从原型对象继承而来的成员,其读和写具有内在的不对等性。比如有一个对象A,假设它的原型对象是B,B的原型对象是null。如果我们需要读取A对象的name属性值,那么JS会优先在A中查找,如果找到了name属性那么就返回;如果A中没有name属性,那么就到原型B中查找name,如果找到了就返回;如果原型B中也没有
- 【持久化框架MyBatis3六】MyBatis3集成第三方DataSource
bit1129
dataSource
MyBatis内置了数据源的支持,如:
<environments default="development">
<environment id="development">
<transactionManager type="JDBC" />
<data
- 我程序中用到的urldecode和base64decode,MD5
bitcarter
cMD5base64decodeurldecode
这里是base64decode和urldecode,Md5在附件中。因为我是在后台所以需要解码:
string Base64Decode(const char* Data,int DataByte,int& OutByte)
{
//解码表
const char DecodeTable[] =
{
0, 0, 0, 0, 0, 0
- 腾讯资深运维专家周小军:QQ与微信架构的惊天秘密
ronin47
社交领域一直是互联网创业的大热门,从PC到移动端,从OICQ、MSN到QQ。到了移动互联网时代,社交领域应用开始彻底爆发,直奔黄金期。腾讯在过去几年里,社交平台更是火到爆,QQ和微信坐拥几亿的粉丝,QQ空间和朋友圈各种刷屏,写心得,晒照片,秀视频,那么谁来为企鹅保驾护航呢?支撑QQ和微信海量数据背后的架构又有哪些惊天内幕呢?本期大讲堂的内容来自今年2月份ChinaUnix对腾讯社交网络运营服务中心
- java-69-旋转数组的最小元素。把一个数组最开始的若干个元素搬到数组的末尾,我们称之为数组的旋转。输入一个排好序的数组的一个旋转,输出旋转数组的最小元素
bylijinnan
java
public class MinOfShiftedArray {
/**
* Q69 旋转数组的最小元素
* 把一个数组最开始的若干个元素搬到数组的末尾,我们称之为数组的旋转。输入一个排好序的数组的一个旋转,输出旋转数组的最小元素。
* 例如数组{3, 4, 5, 1, 2}为{1, 2, 3, 4, 5}的一个旋转,该数组的最小值为1。
*/
publ
- 看博客,应该是有方向的
Cb123456
反省看博客
看博客,应该是有方向的:
我现在就复习以前的,在补补以前不会的,现在还不会的,同时完善完善项目,也看看别人的博客.
我刚突然想到的:
1.应该看计算机组成原理,数据结构,一些算法,还有关于android,java的。
2.对于我,也快大四了,看一些职业规划的,以及一些学习的经验,看看别人的工作总结的.
为什么要写
- [开源与商业]做开源项目的人生活上一定要朴素,尽量减少对官方和商业体系的依赖
comsci
开源项目
为什么这样说呢? 因为科学和技术的发展有时候需要一个平缓和长期的积累过程,但是行政和商业体系本身充满各种不稳定性和不确定性,如果你希望长期从事某个科研项目,但是却又必须依赖于某种行政和商业体系,那其中的过程必定充满各种风险。。。
所以,为避免这种不确定性风险,我
- 一个 sql优化 ([精华] 一个查询优化的分析调整全过程!很值得一看 )
cwqcwqmax9
sql
见 http://www.itpub.net/forum.php?mod=viewthread&tid=239011
Web翻页优化实例
提交时间: 2004-6-18 15:37:49 回复 发消息
环境:
Linux ve
- Hibernat and Ibatis
dashuaifu
Hibernateibatis
Hibernate VS iBATIS 简介 Hibernate 是当前最流行的O/R mapping框架,当前版本是3.05。它出身于sf.net,现在已经成为Jboss的一部分了 iBATIS 是另外一种优秀的O/R mapping框架,当前版本是2.0。目前属于apache的一个子项目了。 相对Hibernate“O/R”而言,iBATIS 是一种“Sql Mappi
- 备份MYSQL脚本
dcj3sjt126com
mysql
#!/bin/sh
# this shell to backup mysql
#
[email protected] (QQ:1413161683 DuChengJiu)
_dbDir=/var/lib/mysql/
_today=`date +%w`
_bakDir=/usr/backup/$_today
[ ! -d $_bakDir ] && mkdir -p
- iOS第三方开源库的吐槽和备忘
dcj3sjt126com
ios
转自
ibireme的博客 做iOS开发总会接触到一些第三方库,这里整理一下,做一些吐槽。 目前比较活跃的社区仍旧是Github,除此以外也有一些不错的库散落在Google Code、SourceForge等地方。由于Github社区太过主流,这里主要介绍一下Github里面流行的iOS库。 首先整理了一份
Github上排名靠
- html wlwmanifest.xml
eoems
htmlxml
所谓优化wp_head()就是把从wp_head中移除不需要元素,同时也可以加快速度。
步骤:
加入到function.php
remove_action('wp_head', 'wp_generator');
//wp-generator移除wordpress的版本号,本身blog的版本号没什么意义,但是如果让恶意玩家看到,可能会用官网公布的漏洞攻击blog
remov
- 浅谈Java定时器发展
hacksin
java并发timer定时器
java在jdk1.3中推出了定时器类Timer,而后在jdk1.5后由Dou Lea从新开发出了支持多线程的ScheduleThreadPoolExecutor,从后者的表现来看,可以考虑完全替代Timer了。
Timer与ScheduleThreadPoolExecutor对比:
1.
Timer始于jdk1.3,其原理是利用一个TimerTask数组当作队列
- 移动端页面侧边导航滑入效果
ini
jqueryWebhtml5cssjavascirpt
效果体验:http://hovertree.com/texiao/mobile/2.htm可以使用移动设备浏览器查看效果。效果使用到jquery-2.1.4.min.js,该版本的jQuery库是用于支持HTML5的浏览器上,不再兼容IE8以前的浏览器,现在移动端浏览器一般都支持HTML5,所以使用该jQuery没问题。HTML文件代码:
<!DOCTYPE html>
<h
- AspectJ+Javasist记录日志
kane_xie
aspectjjavasist
在项目中碰到这样一个需求,对一个服务类的每一个方法,在方法开始和结束的时候分别记录一条日志,内容包括方法名,参数名+参数值以及方法执行的时间。
@Override
public String get(String key) {
// long start = System.currentTimeMillis();
// System.out.println("Be
- redis学习笔记
MJC410621
redisNoSQL
1)nosql数据库主要由以下特点:非关系型的、分布式的、开源的、水平可扩展的。
1,处理超大量的数据
2,运行在便宜的PC服务器集群上,
3,击碎了性能瓶颈。
1)对数据高并发读写。
2)对海量数据的高效率存储和访问。
3)对数据的高扩展性和高可用性。
redis支持的类型:
Sring 类型
set name lijie
get name lijie
set na
- 使用redis实现分布式锁
qifeifei
在多节点的系统中,如何实现分布式锁机制,其中用redis来实现是很好的方法之一,我们先来看一下jedis包中,有个类名BinaryJedis,它有个方法如下:
public Long setnx(final byte[] key, final byte[] value) {
checkIsInMulti();
client.setnx(key, value);
ret
- BI并非万能,中层业务管理报表要另辟蹊径
张老师的菜
大数据BI商业智能信息化
BI是商业智能的缩写,是可以帮助企业做出明智的业务经营决策的工具,其数据来源于各个业务系统,如ERP、CRM、SCM、进销存、HER、OA等。
BI系统不同于传统的管理信息系统,他号称是一个整体应用的解决方案,是融入管理思想的强大系统:有着系统整体的设计思想,支持对所有
- 安装rvm后出现rvm not a function 或者ruby -v后提示没安装ruby的问题
wudixiaotie
function
1.在~/.bashrc最后加入
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
2.重新启动terminal输入:
rvm use ruby-2.2.1 --default
把当前安装的ruby版本设为默