我正在UITextView使用flite-1.4-iphone 进行文字转换.在阅读文本时,我想自动逐字突出显示文本.
这是我目前的代码:
-(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) 我有一个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同时打开相机
提前致谢......