小编iCr*_*Dev的帖子

文本到语音:逐字突出显示iphone

我正在UITextView使用flite-1.4-iphone 进行文字转换.在阅读文本时,我想自动逐字突出显示文本.

  1. 如何在阅读时将语音与文本突出显示同步?
  2. 如何突出显示文本视图中的文本?

这是我目前的代码:

-(IBAction)btnClick:(id)sender
{
    [indicator startAnimating]; 
    textToSpeech = [[TextToSpeech alloc] init]; 
    [textToSpeech setVoice:@"cmu_us_awb"];
    [textToSpeech speakText:txtview.text];
    if ([txtview.text isEqualToString:@""]) 
    {
        [textToSpeech stopTalking];
        [self animate];
    }
}
Run Code Online (Sandbox Code Playgroud)

text-to-speech uitextview ios flite

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

uipopover问题,同时单击并打开相机的ipad

我有一个popoverview问题,而点击并打开相机的ipad,我写了这样的代码

-(IBAction)business_takephotobtnClicked   // click the button show the popoverview

{ 

NSLog(@"business_takephotobtnClicked");
    appdelegate.takePhoto=2;

    popover = [[UIPopoverController alloc] 
               initWithContentViewController:imgclass];

    popover.popoverContentSize =  CGSizeMake(138,66);
    [popover presentPopoverFromRect:popbtn_business.bounds inView:popbtn_business 
    permittedArrowDirections:UIPopoverArrowDirectionUp + 
    UIPopoverArrowDirectionLeft 
    animated:YES]; 
}





-(IBAction) takePhoto:(id)sender // to open the camera

{




    if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) 
    {

       self.contentSizeForViewInPopover=CGSizeMake(138,66);




        UIPicker.sourceType = UIImagePickerControllerSourceTypeCamera;
        [self presentModalViewController:self.UIPicker animated:YES];

    }
    else {
        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:nil message:@"Camera is not available" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:nil];
        [alert show];
        [alert release];


    }

}
Run Code Online (Sandbox Code Playgroud)

在单击按钮之前,弹出窗口就像那个节目一样在此输入图像描述

点击拍照(Neem照片按钮).POPOVERVIEW SIZE自动扩展为taht在此输入图像描述

但我也需要一个相同尺寸的popoverview同时打开相机

提前致谢......

uipopovercontroller ios

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