enter image description here 여기에 이미지 설명을 입력하십시오 : enter image description here. Objective-C의 UIWbeview
에 GIF 이미지를 추가하려고합니다. 문제는 이미지 크기가 화면에 맞지 않아 gif 비디오 위의 내용이 표시되지 않는다는 것입니다. 이미지 크기를 조정하고 위에있는 버튼을 표시하는 방법.UIWebview에서 gif 비디오 파일 추가
내 코드는 다음과 같습니다
이- (void)viewDidLoad {
[super viewDidLoad];
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"back" ofType:@"gif"];
NSData *gif = [NSData dataWithContentsOfFile:filePath];
UIWebView *webViewBG = [[UIWebView alloc] initWithFrame:self.view.frame];
[webViewBG loadData:gif MIMEType:@"gif" textEncodingName:NULL baseURL:NULL];
webViewBG.userInteractionEnabled = NO;
webViewBG.scalesPageToFit=YES;
[self.view addSubview:webViewBG];
// Do any additional setup after loading the view.
}
GIF에 코드를 이동할 수있는 것은 이미지가 아닌 동영상입니다. 당신은 질문이 명확하지 않다, 더 많은 설명과 함께 일부 스크린 샷을 추가하십시오. – iphonic
VC –
https://medium.com/swift-programming?source=logo-lo_70f977b2b7e9---5396e0e8bc29의 screenShot을 공유하십시오. 그럼 다음. @iphonic –