在我的应用程序中,我想在uiview上应用模糊效果.所以我怎样才能实现模糊效果.我试过下面的代码:
UIGraphicsBeginImageContext(scrollview.bounds.size);
[scrollview.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
//Blur the UIImage with a CIFilter
CIImage *imageToBlur = [CIImage imageWithCGImage:viewImage.CGImage];
CIFilter *gaussianBlurFilter = [CIFilter filterWithName: @"CIGaussianBlur"];
[gaussianBlurFilter setValue:imageToBlur forKey: @"inputImage"];
[gaussianBlurFilter setValue:[NSNumber numberWithFloat:3] forKey: @"inputRadius"];
CIImage *resultImage = [gaussianBlurFilter valueForKey: @"outputImage"];
UIImage *endImage = [[UIImage alloc] initWithCIImage:resultImage];
//Place the UIImage in a UIImageView
UIImageView *newView = [[UIImageView alloc] initWithFrame:scrollview.bounds];
newView.image = endImage;
[scrollview addSubview:newView];
Run Code Online (Sandbox Code Playgroud)
但是使用此代码时遇到问题.当应用模糊效果时,时间视图变小.
我将my_app.ipa文件提交给Facebook,但被Facebook拒绝.并向我发送此消息"来自我们的审核小组的消息iPhone可以请您重新提交以供审核,提供您的iOS应用程序的模拟器构建,而不是.ipa文件吗?我正在审核您在需要您的应用程序的iOS模拟器中的提交按照以下说明构建:(.zip)https://developers.facebook.com/docs/ios/creating-ios-simulator-build-for-review "但是我可以创建模拟器构建的.zip文件.我也尝试了下面的步骤
Step 1: open finder and press option+ shift+g
Step 2: paste "~/Library/Developer/Xcode/DerivedData"
Step 3: select my_app-jkfksdfhskdhfksdh some this like this folder
Step 4: my_app-jkfksdfhskdhfksdh >>Build >>Products>>Debug-iphonesimulator
Step 5: I see 2 file one is my_app(icon like rounder and 1 cross line ) and 2nd file is my_app.app.dsym
Run Code Online (Sandbox Code Playgroud) 我想抽屉动画.所以我拿了1个UIView并在UIView中添加了4个控件.现在当我点击抽屉按钮时,在抽屉关闭时设置视图高度为零,在抽屉打开时设置视图高度200.
但是当我设置零高度时,按钮不会隐藏.所有按钮都可见. 自动布局不在我的项目中.
如何解决这个问题.
-(IBAction)Onclick_drawer:(id)sender
{
if(is_open)
{
is_open=false;
[UIView animateWithDuration:0.3
delay:0.0
usingSpringWithDamping:1.0
initialSpringVelocity:4.0
options: UIViewAnimationOptionCurveEaseInOut
animations:^{
self.drawer_view.frame=CGRectMake(0, 64, 320,200);
}
completion:^(BOOL finished){
}];
[UIView commitAnimations];
}
else
{
is_open=true;
[UIView animateWithDuration:0.3
delay:0.0
usingSpringWithDamping:1.0
initialSpringVelocity:4.0
options: UIViewAnimationOptionCurveEaseInOut
animations:^{
self.drawer_view.frame=CGRectMake(0, 64, 320, 0);
}
completion:^(BOOL finished){
}];
[UIView commitAnimations];
}
}
Run Code Online (Sandbox Code Playgroud) 我希望在全屏模式下以横向模式播放视频.我的应用程序锁定在纵向模式.如何实现这一点.请帮我.提前致谢
我需要每5秒调用一次后台服务,但我在Android 5.1(Lollipop)中遇到问题:它会自动将间隔时间视为1分钟.
请帮我每5秒运行一次后台服务.
我想播放youtube网址的视频.我正在使用下面的代码,但它无法正常工作.
-(void)playVideoFromURL
{
NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"%s","https://www.youtube.com/embed/96ReVjMAXEE?autoplay=1&vq=small"]];
self.videoController = [[MPMoviePlayerController alloc] initWithContentURL:url];
[self.videoController setControlStyle:MPMovieControlStyleNone];
self.videoController.repeatMode=MPMovieRepeatModeOne;
self.videoController.fullscreen=YES;
self.videoController.scalingMode=MPMovieScalingModeFill;
self.videoController.view.frame=CGRectMake(0,0,self.videoplayview.frame.size.width, self.videoplayview.frame.size.height);
[self.videoplayview addSubview:self.videoController.view];
[self.videoController play];
}
Run Code Online (Sandbox Code Playgroud) ios ×6
objective-c ×5
uiview ×2
android ×1
animation ×1
blur ×1
facebook ×1
landscape ×1
uiblureffect ×1
youtube ×1