设置按钮的长和宽尺寸一致(即为正方形),然后将圆角半径设为边长的一半,即形成一个圆形 UIButton *btn = [UIButton buttonWithType:UIButtonTypeSystem]; btn.frame = CGRectMake(, , , ); // 设置按钮四个圆角的半径,默认为0,这里取边长一半便是一个圆 btn.layer.cornerRadius = 50.0; // 设置边框的宽度 btn.layer.borderWidth = 1.0; CGColorSp…
IOS8 设置TableView Separatorinset 分割线从边框顶端开始   在ios8上 [TableViewsetSeparatorInset:UIEdgeInsetsMake(0,0,0,0)];不起作用 经过测试加入下面方法 在ios7 8上都可以正常工作 -(void)viewDidLayoutSubviews{    if ([self.tableView respondsToSelector:@selector(setSeparatorInset:)]) {      …
html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption…
本篇文章小编为大家介绍,用NPOI创建Excel.合并单元格.设置单元格样式.边框的方法.需要的朋友参考下 今天在做项目中,遇到使用代码生成具有一定样式的Excel,找了很多资料,最后终于解决了,Excel中格式的设置,以及单元格的合并等等.下面就介绍下,使用NPOI类库操作Excel的方法. 1.首先我们先在内存中生成一个Excel文件,代码如下:   HSSFWorkbook book = new HSSFWorkbook();        ISheet sheet = book.Crea…
UIButton *signBtn = [UIButton buttonWithType:UIButtonTypeCustom]; signBtn.frame = CGRectMake(, , , ); [signBtn.layer setMasksToBounds:YES]; [signBtn.layer setCornerRadius:10.0]; //设置矩形四个圆角半径 [signBtn.layer setBorderWidth:1.0]; //边框宽度 CGColorSpaceRef…
UIButton *signBtn = [UIButton buttonWithType:UIButtonTypeCustom]; signBtn.frame = CGRectMake(, , , ); [signBtn.layer setMasksToBounds:YES]; [signBtn.layer setCornerRadius:10.0]; //设置矩形四个圆角半径 [signBtn.layer setBorderWidth:1.0]; //边框宽度 CGColorSpaceRef…
1. 按钮边框颜色 //设置边框颜色 [btn.layer setMasksToBounds:YES]; [btn.layer setCornerRadius:10.0]; //设置矩形四个圆角半径 //边框宽度 [btn.layer setBorderWidth:1.0]; //设置边框颜色有两种方法:第一种如下: // CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); // CGColorRef colorref = CG…
UIButton *testButton = [UIButton buttonWithType:UIButtonTypeSystem]; [testButton setFrame:CGRectMake(self.view.frame.size.width/2, self.view.frame.size.height/2, 100, 100)]; [testButton setTitle:@"获取屏幕尺寸" forState:UIControlStateNormal]; [testBut…
创建button设置可以折行显示 - (void)viewDidLoad { [super viewDidLoad]; UIButton * button = [[UIButton alloc] initWithFrame:CGRectMake(20, 30, 150, 70)]; [self.view addSubview:button]; [button setTitle:@"button" forState:UIControlStateNormal]; [button setTi…
一,设置单选效果 - (void)selectedBtnPress:(UIButton*)sender { //首先把原来按钮的选中效果消除 for (int i=0;i<num;i++) {//num为总共设置单选效果按钮的数目 UIButton *btn = (UIButton*)[view viewWithTag:i];//view为这些btn的父视图 btn.selected = NO; } sender.selected = YES;//sender.selected = !sende…