外贸常用缩写代码
外贸常用英文缩略词
1 CF (costfreight)成本加运费价
2 T/T (telegraphic transfer)电汇
3 D/P (document against payment)付款交单
4 D/A (document against acceptance)承兑交单
5 C.O (certificate of origin)一般原产地证
6 G.S.P. (generalized system of preferences)普惠制
7 CTN/CTNS (carton/cartons)纸箱
8 PCE/PCS (piece/pieces)只、的个、的支等
9 DL/DLS (dollar/dollars)美元
10 DOZ/DZ (dozen)一打
11 PKG (package)一包,一捆,一扎,一件等
12 WT (weight)重量
13 G.W. (gross weight)毛重
14 N.W. (net weight)净重
15 C/D (customs declaration)报关单
16 EA (each)每个,各
17 W (with)具有
18 w/o (without)没有
19 FAC (facsimile)传真
20 IMP (import)进口
21 EXP (export)出口
22 MAX (maximum)更大的、的更大限度的
23 MIN (minimum)最小的,更低限度
24 M 或MED (medium)中等,中级的
25 M/V (merchant vessel)商船
26 S.S (steamship)船运
27 MT或M/T (metric ton)公吨
28 DOC (document)文件、的单据
29 INT (international)国际的
30 P/L (packing list)装箱单、的明细表
31 INV (invoice)发票
32 PCT (percent)百分比
33 REF (reference)参考、的查价
34 EMS (express mail special)特快传递
35 STL. (style)式样、的款式、的类型
36 T或LTX或TX(telex)电传
37 RMB (renminbi)人民币
38 S/M (shipping marks)装船标记
39 PR或PRC (price) 价格
40 PUR (purchase)购买、的购货
41 S/C (sales contract)销售确认书
42 L/C (letter of credit)信用证
43 B/L (bill of lading)提单
44 FOB (free on board)离岸价
45 CIF (cost,insurancefreight)成本、的保险加运费价
补充:
CR=credit贷方,债主
DR=debt借贷方
(注意:国外常说的debt card,就是银行卡,credit card就是信誉卡。这里都是指银行和财务公司说的,你的银行卡,是你将钱放入银行,银行是“借贷方”,所以叫做debt卡。用credit卡,是你从银行或者财政公司借钱,银行或公司是“贷方”,所就叫credit。)
Exp=Expense花费,费用
O/H=overhead常用开支
TC=total cost总费用
FC=fixed cost常设费用
VC=variable cost变动费用
P=profit竟利润
S=sales销售总额
Rev=revenue利润
MC=marginal cost费用差额
GM=gross margin毛利
MR=marginal revenue利润差额
A/R=acount receivable待收款(销售后,记账以后收取。)
A/P=account payable代付费(花费后记账,以后付费。)
PMT=payment支付款
N/I=net income纯收入
AMT=amount数额
DCT=discount打折
csgo发刀的代码
csgo发刀 *** 如下:
1、首先工作台输入:sv_cheats1;
2、然后再输入发刀指令:mp_drop_knife_enable1;
3、最后输入想要刀的指令就可以了,不同的刀有不同的指令。
csgo常用代码:sv_cheats0/1//*关闭/打开作弊模式;noclip//飞行模式开关;god//无敌模式开关(但被打会掉甲);gods//所有人无敌模式开关;kill//*原地去世;hurtmex//对自己造成xHP伤害;echo文本//在控制台显示文本;cvarlist文本//这两项打开的话会导致无法丢枪);mp_respawn_immunitytimex//设置复活无敌时间为x秒;//TK与队友互动;mp_friendlyfire0/1//关闭/开启友军伤害;mp_autokick0/1//禁用/启用自动踢出挂机或tk的玩家;mp_teammates_are_enemies0/1//参数为1时队友互相为敌人(机器人队友也会相互攻击)。
网页设计常用HTML代码
网页设计常用HTML代码大全
HTML是用来描述网页的一种语言。下面我为大家分享HTML代码,希望对大家学习html代码有帮助!
忽视右键
body oncontextmenu="return false"
或
body style="overflow-y:hidden"
1.如何几秒后转到别的页面?
META HTTP-EQUIV="Refresh" CONTENT="时间;URL=地址"
2.点击关闭窗口
a href="javascript:top.window.close();"点击关闭窗口/a!
3.请问如何去掉主页右面的滚动条?
body scroll="no"
body style="overflow-y:hidden"
4.请问如何做到让一个网页自动关闭.
html
head
OBJECT id=closes type="application/x-oleobject" classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11"
param name="Command" value="Close"
/object
/head
body onload="window.setTimeout(‘‘‘‘closes.Click()‘‘‘‘,10000)"
这个窗口会在10秒过后自动关闭,而且不会出现提示. /body
如何在不刷新页面的情况下刷新css?
style
button{ color:#000000;}
/style
button onclick=document.styleSheets[0].rules[0].style.color=‘‘‘‘red‘‘‘‘点击按钮直接修改style标签里button选择符使按钮改为红色/button
请问如何让网页自动刷新?
在head部记入META HTTP-EQUIV="Refresh" content="20"其中20为20秒后自动刷新,你可以更改为任意值。
5.如何让页面自动刷新?
*** 一,用refresh
HTML 代码片段如下:
head
meta http-equiv="refresh" content="5"
/head
5表示刷新时间
[Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]
*** 二,使用setTimeout控制
img src=/logo.gif
script
function rl(){
document.location.reload()
}
setTimeout(rl,2000)
/script
6.如何让超链接没有下划线
在源代码中的HEAD…/HEAD之间输入如下代码:
style type="text/css" !--
a { text-decoration: none}
-- /style
7.请问如何去掉IE的上下滚动条?
body style=‘‘‘‘overflow:scroll;overflow-y:hidden‘‘‘‘
/body
8.怎样才能把RealPlayer文件在网页做一个试听连接?
embed height=25 src=51js.rm type=audio/x-pn-realaudio-plugin width=50 autostart="false" controls="PlayButton"
9.如何用html实现浏览器上后退按钮的功能?
a href="java script:history.go(-1)"点击后退/a
或者
script history.back() /script
10.请问怎么在网页中改变鼠标的箭头形状?
HTML 代码片段如下:
body
a href="#" style="cursor: auto;"auto/abr
a href="#" style="cursor: crosshair "crosshair /abr
a href="#" style="cursor: default "default /abr
a href="#" style="cursor: hand "hand /abr
a href="#" style="cursor: move "move /abr
a href="#" style="cursor: e-resize "e-resize /abr
a href="#" style="cursor: ne-resize "ne-resize /abr
a href="#" style="cursor: nw-resize"nw-resize/abr
a href="#" style="cursor: n-resize"n-resize/abr
a href="#" style="cursor: se-resize"se-resize/abr
a href="#" style="cursor: sw-resize"sw-resize/abr
a href="#" style="cursor: s-resize"s-resize/abr
a href="#" style="cursor: w-resize"w-resize/abr
a href="#" style="cursor: text"text/abr
a href="#" style="cursor: wait"wait/abr
a href="#" style="cursor: help"help/abr
/body
11.怎样不使用页面的缓存?即每一次打开页面时不是调用缓存中的东西
META HTTP-EQUIV="Pragma" CONTENT="no-cache"
12.页面打开时自动弹出一个窗口的代码怎么写?
HTML 代码片段如下:
html
head
titleUntitled Document/title
meta http-equiv="Content-Type" content="text/html; charset=gb2312"
script language="B style="color:black;background-color:#A0FFFF"javascript/B"
!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//--
/script
/head
body bgcolor="#FFFFFF" text="#000000" onLoad="MM_openBrWindow(‘‘‘‘‘‘‘‘,‘‘‘‘,‘‘‘‘width=400,height=400‘‘‘‘)"
/body
/html
13.如何让我的页面出现一个会讲话的小人?Merlin
HTML 代码片段如下:
HTML
HEAD
TITLE默林/TITLE
META http-equiv=Content-Type content="text/html; charset=gb2312"
/HEAD
BODY
pOBJECT id=sims classid=CLSID:D45FD31B-5C6E-11D1-9EC1-00C04FD7081F
/OBJECT
SCRIPT
var MerlinID;
var MerlinACS;
sims.Connected = true;
MerlinLoaded = LoadLocalAgent(MerlinID, MerlinACS);
Merlin = sims.Characters.Character(MerlinID);
Merlin.Show();
Merlin.Play("Surprised");
Merlin.Speak("大家好");
Merlin.Play("GestureLeft");
Merlin.Think("我是默林!");
Merlin.Play("Pleased");
Merlin.Think("可爱吗?");
Merlin.Play("GestureDown");
Merlin.Speak("哈哈!");
Merlin.Hide();
function LoadLocalAgent(CharID, CharACS){
LoadReq = sims.Characters.Load(CharID, CharACS);
return(true);
}
/SCRIPT
/p
p /p
p看此效果必须装有office2000!!!/p
/BODY
/HTML
14.在页面中如何加入不是满铺的背景图片,拉动页面时背景图不动
HTML 代码片段如下:
htmlhead
STYLE
body {background-image:url(logo.gif);
background-repeat:no-repeat; background-position:center }
/STYLE
/head
body bgproperties="fixed"
/body
/html
[Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]
background-repeat:no-repeat; 是让背景图不占满整个页面
body bgproperties="fixed" 是拉动scroll时背景图不动
15.文本输入框什么属性能实现不可输入?
HTML 代码片段如下:
input type="text" name="textfield" disabled
或者
input type="text" name="textfield" readonly
16.如何禁止自己的页面在别人的框架里打开?
把以下代码加至你的head区
script
if (window.top!=self){
window.top.location=self.location
}
/script
17.如何实现首页全屏幕显示?
HTML 代码片段如下:
html
bodyscript language="B style="color:black;background-color:#A0FFFF"javascript/B"
var coolw=642
var coolh=400
var coolhuang=window.open("","coolhuang","width="+coolw+",height="+coolh+",
fullscreen=1,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0")
window.close()
/script/body/html
18.如何监听一个窗口被关闭了?
HTML 代码片段如下:
body onunload="alert(‘‘‘‘你关闭了这个窗口‘‘‘‘)"
19.如何禁止Ctrl+N?
HTML 代码片段如下:
body onkeydown=return(!(event.keyCode==78event.ctrlKey))
如何把页面加入用户的收藏夹?
HTML 代码片段如下:
a href="B style="color:black;background-color:#A0FFFF"javascript/B:window.external.AddFavorite(‘‘‘‘‘‘‘‘,‘‘‘‘无忧脚本‘‘‘‘)"收藏无忧脚本/a
如何在我的'页面中加入背景音乐?
IE: bgsound src="*.mid" loop=infinite
NS:embed src="*.mid" autostart=true hidden=true loop=true
*.mid你的背景音乐的midi格式文件
关于页面转换效果
meta http-equiv="page-enter" content="revealTrans(Duration=4,Transition=23)"
或
meta http-equiv="page-exit" content="revealTrans(Duration=4,Transition=23)"
说明:Transition=23是随机效果,另可以选0-22任一数字固定某个效果
如何设定打开页面的大小
HTML 代码片段如下:
body onload="top.resizeTo(300,200);"!--(width,height)--
怎样双击滚屏,单击停止?
HTML 代码片段如下:
html
head
title新网页1/title
/head
body
script language"B style="color:black;background-color:#A0FFFF"javascript/B"
var currentpos,timer;
function initialize()
{
timer=setInterval("scrollwindow()",10);
}
function sc(){
clearInterval(timer);
}
function scrollwindow()
{
currentpos=document.body.scrollTop;
window.scroll(0,++currentpos);
if (currentpos != document.body.scrollTop)
sc();
}
document.onmousedown=sc
document.ondblclick=initialize
/script
pa/ppa/ppa/ppaa/ppaa/ppaa/p
paa/ppaa/ppaa/ppaa/ppaa/ppaa/p
paa/ppaa/ppaa/ppaa/ppaa/ppaa/p
paa/ppaa/ppaa/ppaa/ppa/p
/body
/html
如何让body中的文字不被选中?
HTML 代码片段如下:
body onselectstart="return false" aaa/body
如何让弹出的窗口不能关闭?
在新开的窗口中加入如下代码
body onunload=open(location.href)
/body
如何让浏览器在保存页面时保存失败?
HTML 代码片段如下:
NOSCRIPT
B style="color:black;background-color:#ffff66"IFRAME/B SRC="*.html"
/B style="color:black;background-color:#ffff66"IFRAME/B
/NOSCRIPT
表单中如何用图片按钮实现 reset?
html
head
script
function aaa(){
document.forms[0].reset()
}
/script
/head
body
form
textarea rows="2" name="S1" cols="20"/textarea
input type="submit" values="提交" name="B1"
image src="logo.gif" onclick=aaa()
/form
/body/html
进入网页时弹出的信息对话框
body onLoad="window.alert(‘‘‘‘欢迎光临本站‘‘‘‘)"
关闭窗口后弹出对话框
body onUnload="window.alert(‘‘‘‘谢谢你的光临!欢迎下次再来!‘‘‘‘)"
告别提示
body onUnload= alert("再见,感谢你的访问!")
右键菜单的 ***
OBJECT id=menu type="application/x-oleobject" classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11"
PARAM name="Command" value="Related Topics,menu"
PARAM name="Item1" value="动易;"
PARAM name="Item2" value="搜狐;"
PARAM name="Item3" value="新浪;"
PARAM name="Item4" value="网易;"
PARAM name="Item5" value="互动学院;"
/OBJECT script if (document.all) document.body.onmousedown=new Function("if (event.button==2) menu.Click();") /script
下拉菜单
object id=HHCtrl type="application/x-oleobject" classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11" PARAM name="Command" value="Related Topics,Menu" PARAM name="Item1" value="aspease;" PARAM name="Item2" value="byhu;" PARAM name="Item3" value="lzz;" /object a href=javascript:HHCtrl.Click() title="下拉菜单"下拉菜单/a
;
常用代码合集
1、禁止手机睡眠
[UIApplication sharedApplication].idleTimerDisabled = YES;
2、隐藏某行cell
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
// 如果是你需要隐藏的那一行,返回高度为0
if(indexPath.row == YouWantToHideRow){
return 0;
} return 44;
}
// 然后再你需要隐藏cell的时候调用
[self.tableView beginUpdates];
[self.tableView endUpdates];
3、禁用button高亮
button.adjustsImageWhenHighlighted = NO;
4、tableview遇到这种报错failed to obtain a cell from its dataSource
是因为你的cell被调用的早了。先循环使用了cell,后又创建cell。顺序错了
可能原因:1、xib的cell没有注册 2、内存中已经有这个cell的缓存了(也就是说通过你的cellId找到的cell并不是你想要的类型),这时候需要改下cell的标识
5、去除数组中重复的对象
NSArray *newArr = [oldArr valueForKeyPath:@“@distinctUnionOfObjects.self"];
6、动态修改ableView的tableHeaderView或者tableFooterView的高度
开发中如果要动态修改tableView的tableHeaderView或者tableFooterView的高度,需要给tableView重新设置,而不是直接更改高度。正确的做法是重新设置一下tableView.tableFooterView = 更改过高度的view。为什么?其实在iOS8以上直接改高度是没有问题的,在iOS8中出现了contentSize不准确的问题,这是解决办法。
7、collectionView的内容小于其宽高的时候是不能滚动的,设置可以滚动:
collectionView.alwaysBounceHorizontal = YES;
collectionView.alwaysBounceVertical = YES;
8、颜色转图片
+ (UIImage *)cl_imageWithColor:(UIColor *)color {
CGRect rect = CGRectMake(0.0f, 0.0f, 1.0f, 1.0f);
UIGraphicsBeginImageContext(rect.size);
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetFillColorWithColor(context, [color CGColor]);
CGContextFillRect(context, rect);
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return image;
}
9、view设置圆角
#define ViewBorderRadius(View, Radius, Width, Color)
[View.layer setCornerRadius:(Radius)];\
[View.layer setMasksToBounds:YES];\
[View.layer setBorderWidth:(Width)];\
[View.layer setBorderColor:[Color CGColor]] // view圆角
10、强/弱引用
#define WeakSelf(type) __weak typeof(type) weak##type = type; // weak
#define StrongSelf(type) __strong typeof(type) type = weak##type; // strong
11、由角度转换弧度
#define DegreesToRadian(x) (M_PI * (x) / 180.0)
12、由弧度转换角度
#define RadianToDegrees(radian) (radian*180.0)/(M_PI)
13、获取app缓存大小
- (CGFloat)getCachSize {
NSUInteger imageCacheSize = [[SDImageCache sharedImageCache] getSize];
//获取自定义缓存大小
//用枚举器遍历 一个文件夹的内容
//1.获取 文件夹枚举器
NSString *myCachePath = [NSHomeDirectory() stringByAppendingPathComponent:@"Library/Caches"];
NSDirectoryEnumerator *enumerator = [[NSFileManager defaultManager] enumeratorAtPath:myCachePath];
__block NSUInteger count = 0;
//2.遍历
for (NSString *fileName in enumerator) {
NSString *path = [myCachePath stringByAppendingPathComponent:fileName];
NSDictionary *fileDict = [[NSFileManager defaultManager] attributesOfItemAtPath:path error:nil];
count += fileDict.fileSize;//自定义所有缓存大小
}
// 得到是字节 转化为M
CGFloat totalSize = ((CGFloat)imageCacheSize+count)/1024/1024;
return totalSize;
}
14、清理app缓存
- (void)handleClearView {
//删除两部分
//1.删除 sd 图片缓存
//先清除内存中的图片缓存
[[SDImageCache sharedImageCache] clearMemory];
//清除磁盘的缓存
[[SDImageCache sharedImageCache] clearDisk];
//2.删除自己缓存
NSString *myCachePath = [NSHomeDirectory() stringByAppendingPathComponent:@"Library/Caches"];
[[NSFileManager defaultManager] removeItemAtPath:myCachePath error:nil];
}
15、几个常用权限判断
if ([CLLocationManager authorizationStatus] ==kCLAuthorizationStatusDenied) {
NSLog(@"没有定位权限");
}
AVAuthorizationStatus statusVideo = [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo];
if (statusVideo == AVAuthorizationStatusDenied) {
NSLog(@"没有摄像头权限");
}
//是否有麦克风权限
AVAuthorizationStatus statusAudio = [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeAudio];
if (statusAudio == AVAuthorizationStatusDenied) {
NSLog(@"没有录音权限");
}
[PHPhotoLibrary requestAuthorization:^(PHAuthorizationStatus status) {
if (status == PHAuthorizationStatusDenied) {
NSLog(@"没有相册权限");
}
}];
16、长按复制功能
- (void)viewDidLoad
{
[self.view addGestureRecognizer:[[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(pasteBoard:)]];
}
- (void)pasteBoard:(UILongPressGestureRecognizer *)longPress {
if (longPress.state == UIGestureRecognizerStateBegan) {
UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
pasteboard.string = @"需要复制的文本";
}
}
17、image拉伸
+ (UIImage *)resizableImage:(NSString *)imageName
{
UIImage *image = [UIImage imageNamed:imageName];
CGFloat imageW = image.size.width;
CGFloat imageH = image.size.height;
return [image resizableImageWithCapInsets:UIEdgeInsetsMake(imageH * 0.5, imageW * 0.5, imageH * 0.5, imageW * 0.5) resizingMode:UIImageResizingModeStretch];
}
18、 *** ON字符串转字典
+ (NSDictionary *)parse *** ONStringToNSDictionary:(NSString *) *** ONString {
NSData * *** ONData = [ *** ONString dataUsingEncoding:NSUTF8StringEncoding];
NSDictionary *response *** ON = [NS *** ONSerialization *** ONObjectWithData: *** ONData options:NS *** ONReadingMutableLeaves error:nil];
return response *** ON;
}
19、画水印
// 画水印
- (void) setImage:(UIImage *)image withWaterMark:(UIImage *)mark inRect:(CGRect)rect
{
if ([[[UIDevice currentDevice] systemVersion] floatValue] = 4.0)
{
UIGraphicsBeginImageContextWithOptions(self.frame.size, NO, 0.0);
}
//原图
[image drawInRect:self.bounds];
//水印图
[mark drawInRect:rect];
UIImage *newPic = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
self.image = newPic;
}
20、身份证号验证
- (BOOL)validateIdentityCard {
BOOL flag;
if (self.length = 0) {
flag = NO;
return flag;
}
NSString *regex2 = @"^(\\d{14}|\\d{17})(\\d|[xX])$";
NSPredicate *identityCardPredicate = [NSPredicate predicateWithFormat:@"SELF MATCHES %@",regex2];
return [identityCardPredicate evaluateWithObject:self];
}
21、移除字符串中的空格和换行
+ (NSString *)removeSpaceAndNewline:(NSString *)str {
NSString *temp = [str stringByReplacingOccurrencesOfString:@" " withString:@""];
temp = [temp stringByReplacingOccurrencesOfString:@"\r" withString:@""];
temp = [temp stringByReplacingOccurrencesOfString:@"\n" withString:@""];
return temp;
}
22、判断字符串中是否有空格
+ (BOOL)isBlank:(NSString *)str {
NSRange _range = [str rangeOfString:@" "];
if (_range.location != NSNotFound) {
//有空格
return YES;
} else {
//没有空格
return NO;
}
}
22、获取一个视频的之一帧图片
NSURL *url = [NSURL URLWithString:filepath];
AVURLAsset *asset1 = [[AVURLAsset alloc] initWithURL:url options:nil];
AVAssetImageGenerator *generate1 = [[AVAssetImageGenerator alloc] initWithAsset:asset1];
generate1.appliesPreferredTrackTransform = YES;
NSError *err = NULL;
CMTime time = CMTimeMake(1, 2);
CGImageRef oneRef = [generate1 copyCGImageAtTime:time actualTime:NULL error:err];
UIImage *one = [[UIImage alloc] initWithCGImage:oneRef];
return one;
23、获取视频的时长
+ (NSInteger)getVideoTimeByUrlString:(NSString *)urlString {
NSURL *videoUrl = [NSURL URLWithString:urlString];
AVURLAsset *avUrl = [AVURLAsset assetWithURL:videoUrl];
CMTime time = [avUrl duration];
int seconds = ceil(time.value/time.timescale);
return seconds;
}
24、UILabel设置内边距
子类化UILabel,重写drawTextInRect ***
- (void)drawTextInRect:(CGRect)rect {
// 边距,上左下右
UIEdgeInsets insets = {0, 5, 0, 5};
[super drawTextInRect:UIEdgeInsetsInsetRect(rect, insets)];
}
25、UILabel设置文字描边
子类化UILabel,重写drawTextInRect ***
- (void)drawTextInRect:(CGRect)rect
{
CGContextRef c = UIGraphicsGetCurrentContext();
// 设置描边宽度
CGContextSetLineWidth(c, 1);
CGContextSetLineJoin(c, kCGLineJoinRound);
CGContextSetTextDrawingMode(c, kCGTextStroke);
// 描边颜色
self.textColor = [UIColor redColor];
[super drawTextInRect:rect];
// 文本颜色
self.textColor = [UIColor yellowColor];
CGContextSetTextDrawingMode(c, kCGTextFill);
[super drawTextInRect:rect];
}
26、在状态栏增加 *** 请求的菊花,类似safari加载网页的时候状态栏菊花
[UIApplication sharedApplication].networkActivityIndicatorVisible = YES;
27、修改cell.imageView的大小
UIImage *icon = [UIImage imageNamed:@""];
CGSize itemSize = CGSizeMake(30, 30);
UIGraphicsBeginImageContextWithOptions(itemSize, NO ,0.0);
CGRect imageRect = CGRectMake(0.0, 0.0, itemSize.width, itemSize.height);
[icon drawInRect:imageRect];
cell.imageView.image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
28、为一个view添加虚线边框
CAShapeLayer *border = [CAShapeLayer layer];
border.strokeColor = [UIColor colorWithRed:67/255.0f green:37/255.0f blue:83/255.0f alpha:1].CGColor;
border.fillColor = nil;
border.lineDashPattern = @[@4, @2];
border.path = [UIBezierPath bezierPathWithRect:view.bounds].CGPath;
border.frame = view.bounds;
[view.layer addSublayer:border];
29、UITextView中打开或禁用复制,剪切,选择,全选等功能
// 继承UITextView重写这个 ***
- (BOOL)canPerformAction:(SEL)action withSender:(id)sender
{
// 返回NO为禁用,YES为开启
// 粘贴
if (action == @selector(paste:)) return NO;
// 剪切
if (action == @selector(cut:)) return NO;
// 复制
if (action == @selector(copy:)) return NO;
// 选择
if (action == @selector(select:)) return NO;
// 选中全部
if (action == @selector(selectAll:)) return NO;
// 删除
if (action == @selector(delete:)) return NO;
// 分享
if (action == @selector(share)) return NO;
return [super canPerformAction:action withSender:sender];
}
30、tableViewCell分割线顶到头
- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath {
[cell setSeparatorInset:UIEdgeInsetsZero];
[cell setLayoutMargins:UIEdgeInsetsZero];
cell.preservesSuperviewLayoutMargins = NO;
}
- (void)viewDidLayoutSubviews {
[self.tableView setSeparatorInset:UIEdgeInsetsZero];
[self.tableView setLayoutMargins:UIEdgeInsetsZero];
}