基本是拖拖拽拽搭界面没啥好说的。
UIButton:
➢UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
➢
➢[btn setBackgroundImage:[UIImage imageNamed:@"okbtn"]
forState:UIControlStateNormal];➢[btn setTitle:@"OK" forState:UIControlStateNormal];
➢[btn setTitleColor:[UIColor redColor] forState:UIControlStateNormal];➢
➢[btn addTarget:self action:@selector(greeting:) forControlEvents:UIControlEventTouchUpInside];
UIImage:
图片资源放在Assets.xcassets里面。图片能切片,就向android的.9图一样,只需选中图片点击如下标注的地方。
关于代码里面的图片加载: