Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
ios
WebView-Test
Commits
f3b55ee7
Commit
f3b55ee7
authored
6 years ago
by
ftao
Browse files
Options
Download
Email Patches
Plain Diff
# 0.1.0 版本
- 支持横竖屏 - 添加蒲公英下载地址
parent
5e63d67b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
4 deletions
+25
-4
README.md
README.md
+6
-0
WebView-Test.xcodeproj/project.pbxproj
WebView-Test.xcodeproj/project.pbxproj
+2
-2
WebView-Test/Info.plist
WebView-Test/Info.plist
+5
-1
WebView-Test/ViewController.m
WebView-Test/ViewController.m
+1
-1
WebView-Test/WebView/WKWebViewController.m
WebView-Test/WebView/WKWebViewController.m
+11
-0
No files found.
README.md
View file @
f3b55ee7
...
...
@@ -28,6 +28,12 @@ UIWebView 在 iOS 11.3 上设置 inline playback 无效,iOS 11.0.3 上可以
-
自动全屏
-
自动播放
[
下载调试
](
https://www.pgyer.com/j9Vw
)
,密码 polyv

### 参考资料
-
[
UIWebView 官方文档
](
https://developer.apple.com/documentation/uikit/uiwebview?language=objc
)
...
...
This diff is collapsed.
Click to expand it.
WebView-Test.xcodeproj/project.pbxproj
View file @
f3b55ee7
...
...
@@ -396,7 +396,7 @@
buildSettings
=
{
ASSETCATALOG_COMPILER_APPICON_NAME
=
AppIcon
;
CODE_SIGN_STYLE
=
Automatic
;
DEVELOPMENT_TEAM
=
ETRBR9HA5V
;
DEVELOPMENT_TEAM
=
8BMZBNN3Q5
;
INFOPLIST_FILE
=
"WebView-Test/Info.plist"
;
IPHONEOS_DEPLOYMENT_TARGET
=
9.0
;
LD_RUNPATH_SEARCH_PATHS
=
"$(inherited) @executable_path/Frameworks"
;
...
...
@@ -412,7 +412,7 @@
buildSettings
=
{
ASSETCATALOG_COMPILER_APPICON_NAME
=
AppIcon
;
CODE_SIGN_STYLE
=
Automatic
;
DEVELOPMENT_TEAM
=
ETRBR9HA5V
;
DEVELOPMENT_TEAM
=
8BMZBNN3Q5
;
INFOPLIST_FILE
=
"WebView-Test/Info.plist"
;
IPHONEOS_DEPLOYMENT_TARGET
=
9.0
;
LD_RUNPATH_SEARCH_PATHS
=
"$(inherited) @executable_path/Frameworks"
;
...
...
This diff is collapsed.
Click to expand it.
WebView-Test/Info.plist
View file @
f3b55ee7
...
...
@@ -4,6 +4,8 @@
<dict>
<key>
CFBundleDevelopmentRegion
</key>
<string>
$(DEVELOPMENT_LANGUAGE)
</string>
<key>
CFBundleDisplayName
</key>
<string>
WebViewTest
</string>
<key>
CFBundleExecutable
</key>
<string>
$(EXECUTABLE_NAME)
</string>
<key>
CFBundleIdentifier
</key>
...
...
@@ -15,7 +17,7 @@
<key>
CFBundlePackageType
</key>
<string>
APPL
</string>
<key>
CFBundleShortVersionString
</key>
<string>
1.0
</string>
<string>
0.
1.0
</string>
<key>
CFBundleVersion
</key>
<string>
1
</string>
<key>
LSRequiresIPhoneOS
</key>
...
...
@@ -36,6 +38,8 @@
<key>
UISupportedInterfaceOrientations
</key>
<array>
<string>
UIInterfaceOrientationPortrait
</string>
<string>
UIInterfaceOrientationLandscapeLeft
</string>
<string>
UIInterfaceOrientationLandscapeRight
</string>
</array>
<key>
UISupportedInterfaceOrientations~ipad
</key>
<array>
...
...
This diff is collapsed.
Click to expand it.
WebView-Test/ViewController.m
View file @
f3b55ee7
...
...
@@ -54,7 +54,7 @@
// In a storyboard-based application, you will often want to do a little preparation before navigation
-
(
void
)
prepareForSegue
:(
UIStoryboardSegue
*
)
segue
sender
:(
id
)
sender
{
NSURL
*
urlPath
=
[
NSURL
URLWithString
:
self
.
urlLabel
.
text
];
// 配置 webView 请求体参数,使用
默认
缓存策略,超时时间设置为 15.0 s
// 配置 webView 请求体参数,使用
忽略存储数据
缓存策略,超时时间设置为 15.0 s
NSURLRequest
*
request
=
[
NSURLRequest
requestWithURL
:
urlPath
cachePolicy
:
NSURLRequestReloadIgnoringCacheData
timeoutInterval
:
15
.
0
];
UIViewController
*
viewController
=
[
segue
destinationViewController
];
...
...
This diff is collapsed.
Click to expand it.
WebView-Test/WebView/WKWebViewController.m
View file @
f3b55ee7
...
...
@@ -37,6 +37,7 @@
// 使用 WKWebViewConfiguration 初始化 WKWebView
self
.
wkWebView
=
[[
WKWebView
alloc
]
initWithFrame
:
self
.
view
.
bounds
configuration
:
configuration
];
self
.
wkWebView
.
autoresizingMask
=
UIViewAutoresizingFlexibleWidth
|
UIViewAutoresizingFlexibleHeight
;
[
self
.
wkWebView
loadRequest
:
self
.
request
];
self
.
wkWebView
.
navigationDelegate
=
self
;
self
.
wkWebView
.
UIDelegate
=
self
;
...
...
@@ -129,6 +130,16 @@
// Dispose of any resources that can be recreated.
}
#pragma mark - view control
-
(
UIInterfaceOrientationMask
)
supportedInterfaceOrientations
{
return
UIInterfaceOrientationMaskAllButUpsideDown
;
}
-
(
BOOL
)
shouldAutorotate
{
return
YES
;
}
/*
#pragma mark - Navigation
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment