1、UIButton
1、自定义button的样式。
UIButton *button = [UIButtonbuttonWithType:UIButtonTypeRoundedRect];
button.frame =CGRectMake(100,100,100,100);
button.layer.masksToBounds =YES;//将子层剪切到button的边缘,而不会出现直角边框。
button.layer.cornerRadius =50;
button.layer.borderWidth =1;
button.layer.borderColor = [UIColordarkGrayColor].CGColor;
2、CALayer
1、定义控件的层。
CALayer *sublayer = [CALayerlayer];
sublayer.backgroundColor = [UIColorlightGrayColor].CGColor;
sublayer.frame =CGRectMake(30,30,128,192);
sublayer.shadowOffset =CGSizeMake(10,10); //下面四句是设置层的阴影形式。
sublayer.shadowRadius =5.0;
sublayer.shadowColor = [UIColorredColor].CGColor;
sublayer.shadowOpacity =0.8;
各句不难理解。
3、发送邮件
Class mailClass = NSClassFromString(@"MFMailComposeViewController");
if (mailClass !=nil && [MFMailComposeViewControllercanSendMail])
{
NSString* mailFileName = [fileName_copy];
NSString* mailFilePath = [filePath_retain];
MFMailComposeViewController *picker = [[MFMailComposeViewControlleralloc]init];
picker.mailComposeDelegate =self;
NSString *mimeType =@"application/pdf";
NSData *attachmentData = [NSDatadataWithContentsOfFile:mailFilePath];
if (mimeType !=nil && [attachmentDatalength] >0)
{
[pickeraddAttachmentData:attachmentData
mimeType:mimeType
fileName:mailFileName];
[selfpresentModalViewController:pickeranimated:YES];
}
[mailFilePathrelease];
[mailFileNamerelease];
[pickerrelease];
}
// Dismisses the email composition interface when users tap Cancel or Send.
// Proceeds to update the message field with the result of the operation.
- (void)mailComposeController:(MFMailComposeViewController *)controller
didFinishWithResult:(MFMailComposeResult)result
error:(NSError *)error
{
NSLog(@"%s",__FUNCTION__);
[selfbecomeFirstResponder];
[selfdismissModalViewControllerAnimated:YES];
}
5.改变系统音量。
MPMusicPlayerController *mpc = [MPMusicPlayerControllerapplicationMusicPlayer];
mpc.volume =0.6; //0.0~1.0
6.关于c,C++,OC.混合编程...
* .c:可以编译C代码
* .cpp:可以编译C/C++代码
* .m:可以编译C/Obj-C代码
* .mm:可以编译C/C++/Obj-C代码
未完待续 ,持续补充之中。。。。。。