使用AVSystemController可以改变系统声音,而且是铃声,并非媒体播放的声音. 它可以让iPhone手机静音.但是,AVSystemController存在于私有Celestial框架中.由于UIKit引用了这个框架,因此仍然可以在不直接引用它的情况下使用该类. Apple禁止使用私有API,因此仅此一点就是个坏主意.鉴于此情况,可能会放弃这个想法,因为我认为它没有解决我的问题.它确实使声音静音,但是当我插入我的配件时,即使振铃音量设置为0,系统也会以最大音量发出声音.这让我相信解决…
                      @iOS调用操作通讯录所用的库文件                                         AddressBook.framework                                         AddressBookUI.framework #import "HMTMainViewController.h" #import <AddressBook/AddressBook.h> #im…
1.改变高度 自定义UINavigationBar的新类别: //UINavigationBar+BackgoundImage.h #import <Foundation/Foundation.h> @interface UINavigationBar (BackgoundImage) @end 在新类别的实现中,覆盖原有类的方法 - (void)drawRect:(CGRect)rect : //UINavigationBar+BackgoundImage.m #import "U…
调用系统相机和相册 (iPad,iPhone)打开相机:(iPad,iPhone)//先设定sourceType为相机,然后判断相机是否可用(ipod)没相机,不可用将sourceType设定为相片库      UIImagePickerControllerSourceType sourceType = UIImagePickerControllerSourceTypeCamera;  //    if (![UIImagePickerController isSourceTypeAvailab…
 调用系统相机和相册 (iPad,iPhone) 打开相机:(iPad,iPhone) //先设定sourceType为相机,然后判断相机是否可用(ipod)没相机,不可用将sourceType设定为相片库       UIImagePickerControllerSourceType sourceType = UIImagePickerControllerSourceTypeCamera;   //    if (![UIImagePickerController isSourceTypeAv…
在 iPhone 或 iPad 的开发中,除了用 touchesBegan / touchesMoved / touchesEnded 这组方法来控制使用者的手指触控外,也可以用 UIGestureRecognizer 的衍生类別来进行判断.用 UIGestureRecognizer 的好处在于有现成的手势,开发者不用自己计算手指移动轨迹.UIGestureRecognizer的衍生类別有以下几种: UITapGestureRecognizer UIPinchGestureRecognizer…
虽然一直知道X-code肯定提供有语言本地化的设置地方,但是一直也做个记录,有些时候的汉化,还是需要使用代码去控制,键盘的右下角.navagiton的return使用代码修改,调用系统相机时,也是出现英文的提示与按钮,这次没办法通过代码修改了,只能进行本地汉化的操作了,很简单的,添加个bool类型的值就行了,如下: 只需要在“info.plist”,添加一项“Localized resources can be mixed”,值设置为“YES”即可!…
1.这四个返回的是后面的单词. UIBarButtonSystemItemDone UIBarButtonSystemItemCancel UIBarButtonSystemItemEdit UIBarButtonSystemItemSave 2.这三个不是按钮,比如第一个是设置间隔的. UIBarButtonSystemItemFlexibleSpace UIBarButtonSystemItemFixedSpace UIBarButtonSystemItemCompose 3.其余的都是图标…
1.先获取tableHeaderView 2.设置它的frame 3.将该view设置回tableview UIView *view=tableView. tableHeaderView; view.frame=newFrame; tableView. tableHeaderView =view; ref:http://www.cocoachina.com/bbs/read.php?tid-115251-page-1.html…
NSString *strJTGZ = [NSString stringWithFormat:@"交通管制%d处 ",[jtgz intValue]]; NSMutableAttributedString *attributedStr = [[NSMutableAttributedString alloc]initWithString:strJTGZ]; [attributedStr addAttribute:NSForegroundColorAttributeName value:[…