小编swe*_*ank的帖子

iPhone: - 以最简单的方式裁剪所需形状和大小的图像

我正在尝试根据我的愿望裁剪图像....我的电影报类型应用程序.....并在我的应用程序中使用它

我已经尝试了很多选项但是tham都没有...对我有用我在堆栈上读取答案但是没用

plzz帮助我

image = [UIImage imageNamed:@"images2.jpg"];
imageView = [[UIImageView alloc] initWithImage:image];

CGSize size = [image size];

[imageView setFrame:CGRectMake(0, 0, size.width, size.height)];
[[self view] addSubview:imageView];
[imageView release];    
Run Code Online (Sandbox Code Playgroud)

谢谢

iphone xcode

7
推荐指数
1
解决办法
2万
查看次数

iphone: - 用UILocalNotification声音播放录制的声音

我能够使用avrecorder录制语音,但它将录制的语音保存在文档目录的路径中,我无法找到在localNotification声音中使用它的方法,所以任何一个plz都能解释这个问题

录音代码: -

-(IBAction)startRecording

{

    AVAudioSession *audioSession = [AVAudioSession sharedInstance];
    NSError *err = nil;
    [audioSession setCategory :AVAudioSessionCategoryPlayAndRecord error:&err];

    NSArray *searchPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString *documentPath = [searchPaths objectAtIndex:0];
    NSLog(@"ccc...%@",documentPath);

    if(toggle)
    {
        toggle = NO;

        recordSetting = [[NSMutableDictionary alloc] init];


        [recordSetting setValue:[NSNumber numberWithInt: 1] forKey:AVNumberOfChannelsKey];


        strRecordedVoice=[NSString stringWithFormat: @"%.0f.%@", [NSDate timeIntervalSinceReferenceDate] * 1000.0, @"caf"];

        recordedTmpFile = [NSURL fileURLWithPath:[documentPath stringByAppendingPathComponent:strRecordedVoice]];
        NSLog(@"Using Filepath called: %@",recordedTmpFile);
        NSLog(@"Using str: %@",strRecordedVoice);

        recorder = [[ AVAudioRecorder alloc] initWithURL:recordedTmpFile settings:recordSetting error:&error];





        [recorder setDelegate:self];
                [recorder prepareToRecord];

        [recorder record];

        progressView.progress …
Run Code Online (Sandbox Code Playgroud)

iphone xcode ios

6
推荐指数
1
解决办法
1513
查看次数

iPhone:UITextView在编辑时不会扩展

我在滚动视图上使用UITextView ...我希望它在我写东西时自动扩展......但我无法做到......

textViewBusiness = [[UITextView alloc] initWithFrame:CGRectMake(25,332,268,60)];
textViewBusiness.text=strMyBusiness;
textViewBusiness.editable=NO;
textViewBusiness.font = [UIFont fontWithName:@"Arial" size: 17.0];
textViewBusiness.layer.borderWidth = 2.0f;
textViewBusiness.layer.borderColor = [[UIColor grayColor] CGColor];
textViewBusiness.backgroundColor = [UIColor clearColor];
[textViewBusiness setTextColor:[UIColor blackColor]];
[self.scrollView addSubview: textViewBusiness];

CGRect frame = textViewBusiness.frame;
frame.size.height = textViewBusiness.contentSize.height;
textViewBusiness.frame = frame;
Run Code Online (Sandbox Code Playgroud)

这段代码对我不起作用......

谢谢

uitextview ios xcode4

1
推荐指数
1
解决办法
2552
查看次数

标签 统计

ios ×2

iphone ×2

xcode ×2

uitextview ×1

xcode4 ×1