1.Textfield 禁用復(fù)制粘貼功能
- (BOOL)canPerformAction:(SEL)action withSender:(id)sender{
if (action == @selector(paste:)){
return NO;
} else {
return [super canPerformAction:action withSender:sender];
}
}
2.sandBox
Documents:蘋果建議將程序中建立的或在程序中瀏覽到的文件數(shù)據(jù)保存在該目錄下拷恨,iTunes備份和恢復(fù)的時(shí)候會(huì)包括此目錄
Library:存儲程序的默認(rèn)設(shè)置或其它狀態(tài)信息
Library/Caches:存放緩存文件稠屠,iTunes不會(huì)備份此目錄污筷,此目錄下文件不會(huì)在應(yīng)用退出刪除
tmp:提供一個(gè)即時(shí)創(chuàng)建臨時(shí)文件的地方
iTunes在與iPhone同步時(shí),備份所有的Documents和Library文件
iPhone在重啟時(shí),會(huì)丟棄所有的tmp文件
3.iOS按鈕點(diǎn)擊顏色變暗
直接設(shè)置一個(gè)正常狀態(tài)下的圖片即可,點(diǎn)擊的時(shí)候會(huì)自動(dòng)變暗
[button setBackgroundImage:[UIImage new] forState:UIControlStateNormal];
3.js
<head>
<style type="text/css">
img {width : 999}
p {font-size : 12px}
</style>
<script>
function change() {
alert('dsfsdfdsfds');
document.getElementById("img").src = "http://img3.imgtn.bdimg.com/it/u=3208942107,1379149852&fm=21&gp=0.jpg";
}
</script>
</head>
<body>
<img id="img" onclick="change(this);" src="http://i532.photobucket.com/albums/ee323/linjuming/questions/a_bind.png"/>
<img src="http://i532.photobucket.com/albums/ee323/linjuming/questions/a_bind.png"/>
<script>
var imgs = document.getElementsByTagName('img');
for (var i = 0, len = imgs.length; i < len; i++) {
var img = imgs[i];
img.onclick = function(){hint();};
}
function hint(){
alert('56465465');
}
function change(id) {
alert(id);
document.getElementById("img").src = "http://img3.imgtn.bdimg.com/it/u=3208942107,1379149852&fm=21&gp=0.jpg";
}
</script>