为App适配iOS11

.markdown-body hr::after,.markdown-body::after { clear: both }
.loopLine,.messageLine0 { }
.markdown-body { color: #24292e; font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; line-height: 1.5 }
.markdown-body .pl-c { color: #969896 }
.markdown-body .pl-c1,.markdown-body .pl-s .pl-v { color: #0086b3 }
.markdown-body .pl-e,.markdown-body .pl-en { color: #795da3 }
.markdown-body .pl-s .pl-s1,.markdown-body .pl-smi { color: #333 }
.markdown-body .pl-ent { color: #63a35c }
.markdown-body .pl-k { color: #a71d5d }
.markdown-body .pl-pds,.markdown-body .pl-s,.markdown-body .pl-s .pl-pse .pl-s1,.markdown-body .pl-sr,.markdown-body .pl-sr .pl-cce,.markdown-body .pl-sr .pl-sra,.markdown-body .pl-sr .pl-sre { color: #183691 }
.markdown-body .pl-smw,.markdown-body .pl-v { color: #ed6a43 }
.markdown-body .pl-bu { color: #b52a1d }
.markdown-body .pl-c2,.markdown-body .pl-ii { color: #f8f8f8; background-color: #b52a1d }
.markdown-body .pl-c2::before { content: "^M" }
.markdown-body .pl-sr .pl-cce { font-weight: 700; color: #63a35c }
.markdown-body .pl-ml { color: #693a17 }
.markdown-body .pl-mh,.markdown-body .pl-mh .pl-en,.markdown-body .pl-ms { font-weight: 700; color: #1d3e81 }
.markdown-body .pl-mq { color: teal }
.markdown-body .pl-mi { font-style: italic; color: #333 }
.markdown-body .pl-mb { font-weight: 700; color: #333 }
.markdown-body .pl-md { color: #bd2c00; background-color: #ffecec }
.markdown-body .pl-mi1 { color: #55a532; background-color: #eaffea }
.markdown-body .pl-mc { color: #ef9700; background-color: #ffe3b4 }
.markdown-body .pl-mi2 { color: #d8d8d8; background-color: grey }
.markdown-body .pl-mdr { font-weight: 700; color: #795da3 }
.markdown-body .pl-mo { color: #1d3e81 }
.markdown-body .pl-ba { color: #595e62 }
.markdown-body .pl-sg { color: silver }
.markdown-body .pl-corl { text-decoration: underline; color: #183691 }
.markdown-body .octicon { display: inline-block; vertical-align: text-bottom }
.markdown-body hr::after,.markdown-body hr::before,.markdown-body::after,.markdown-body::before { display: table; content: "" }
.markdown-body a { background-color: transparent; color: #0366d6; text-decoration: none }
.markdown-body a:active,.markdown-body a:hover { outline-width: 0 }
.markdown-body h1 { margin: .67em 0 }
.markdown-body img { border-style: none }
.markdown-body svg:not(:root) { overflow: hidden }
.markdown-body hr { }
.markdown-body input { font: inherit; margin: 0; overflow: visible; font-family: inherit; font-size: inherit; line-height: inherit }
.markdown-body [type="checkbox"] { padding: 0 }
.markdown-body * { }
.markdown-body a:hover { text-decoration: underline }
.markdown-body strong { font-weight: 600 }
.markdown-body td,.markdown-body th { padding: 0 }
.markdown-body blockquote { margin: 0 }
.markdown-body ol ol,.markdown-body ul ol { list-style-type: lower-roman }
.markdown-body ol ol ol,.markdown-body ol ul ol,.markdown-body ul ol ol,.markdown-body ul ul ol { list-style-type: lower-alpha }
.markdown-body .task-list-item,ul.table-of-contents { list-style-type: none }
.markdown-body dd { margin-left: 0 }
.markdown-body code { font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace }
.markdown-body pre { font: 12px SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace }
.markdown-body .pl-0 { padding-left: 0 !important }
.markdown-body .pl-1 { padding-left: 4px !important }
.markdown-body .pl-2 { padding-left: 8px !important }
.markdown-body .pl-3 { padding-left: 16px !important }
.markdown-body .pl-4 { padding-left: 24px !important }
.markdown-body .pl-5 { padding-left: 32px !important }
.markdown-body .pl-6 { padding-left: 40px !important }
.markdown-body>:first-child { margin-top: 0 !important }
.markdown-body>:last-child { margin-bottom: 0 !important }
.markdown-body a:not([href]) { color: inherit; text-decoration: none }
.markdown-body .anchor { float: left; padding-right: 4px; margin-left: -20px; line-height: 1 }
.markdown-body .anchor:focus { outline: 0 }
.markdown-body blockquote,.markdown-body dl,.markdown-body ol,.markdown-body p,.markdown-body pre,.markdown-body table,.markdown-body ul { margin-top: 0; margin-bottom: 16px }
.markdown-body hr { overflow: hidden; background: #e1e4e8; height: .25em; padding: 0; margin: 24px 0; border: 0 }
.markdown-body blockquote { padding: 0 1em; color: #6a737d; border-left: .25em solid #dfe2e5 }
.markdown-body h1,.markdown-body h2 { padding-bottom: .3em; border-bottom: 1px solid #eaecef }
.markdown-body blockquote>:first-child { margin-top: 0 }
.markdown-body blockquote>:last-child { margin-bottom: 0 }
.markdown-body h1,.markdown-body h2,.markdown-body h3,.markdown-body h4,.markdown-body h5,.markdown-body h6 { margin-top: 24px; margin-bottom: 16px; font-weight: 600; line-height: 1.25 }
.markdown-body h1 .octicon-link,.markdown-body h2 .octicon-link,.markdown-body h3 .octicon-link,.markdown-body h4 .octicon-link,.markdown-body h5 .octicon-link,.markdown-body h6 .octicon-link { color: #1b1f23; vertical-align: middle; visibility: hidden }
.markdown-body h1:hover .anchor,.markdown-body h2:hover .anchor,.markdown-body h3:hover .anchor,.markdown-body h4:hover .anchor,.markdown-body h5:hover .anchor,.markdown-body h6:hover .anchor { text-decoration: none }
.markdown-body h1:hover .anchor .octicon-link,.markdown-body h2:hover .anchor .octicon-link,.markdown-body h3:hover .anchor .octicon-link,.markdown-body h4:hover .anchor .octicon-link,.markdown-body h5:hover .anchor .octicon-link,.markdown-body h6:hover .anchor .octicon-link { visibility: visible }
.markdown-body h6 { color: #6a737d }
.markdown-body ol,.markdown-body ul { padding-left: 2em }
.markdown-body ol ol,.markdown-body ol ul,.markdown-body ul ol,.markdown-body ul ul { margin-top: 0; margin-bottom: 0 }
.markdown-body li>p { margin-top: 16px }
.markdown-body li+li { margin-top: .25em }
.markdown-body dl { padding: 0 }
.markdown-body dl dt { padding: 0; margin-top: 16px; font-size: 1em; font-style: italic; font-weight: 600 }
.markdown-body dl dd { padding: 0 16px; margin-bottom: 16px }
.markdown-body table { border-spacing: 0; border-collapse: collapse; display: block; width: 100%; overflow: auto }
.markdown-body table th { font-weight: 600 }
.markdown-body table td,.markdown-body table th { padding: 6px 13px; border: 1px solid #dfe2e5 }
.markdown-body table tr { background-color: #fff; border-top: 1px solid #c6cbd1 }
.markdown-body table tr:nth-child(2n) { background-color: #f6f8fa }
.markdown-body img { max-width: 100%; background-color: #fff }
.markdown-body code { padding: .2em 0; margin: 0; font-size: 85%; background-color: rgba(27,31,35,.05) }
.markdown-body code::after,.markdown-body code::before { letter-spacing: -.2em; content: "?" }
.markdown-body pre>code { padding: 0; margin: 0; font-size: 100%; white-space: pre; background: 0 0; border: 0 }
.markdown-body .highlight { margin-bottom: 16px }
.markdown-body .highlight pre { margin-bottom: 0 }
.markdown-body .highlight pre,.markdown-body pre { padding: 16px; overflow: auto; font-size: 85%; line-height: 1.45; background-color: #f6f8fa }
.markdown-body pre code { display: inline; max-width: auto; padding: 0; margin: 0; overflow: visible; line-height: inherit; background-color: transparent; border: 0 }
.markdown-body pre code::after,.markdown-body pre code::before { content: normal }
.markdown-body .full-commit .btn-outline:not(:disabled):hover { color: #005cc5; border-color: #005cc5 }
.markdown-body kbd { display: inline-block; padding: 3px 5px; font: 11px SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; line-height: 10px; color: #444d56; vertical-align: middle; background-color: #fcfcfc; border: 1px solid #c6cbd1; border-bottom-color: #959da5 }
.node text,.noteText,div.mermaidTooltip { font-family: "trebuchet ms", verdana, arial }
.markdown-body :checked+.radio-label { position: relative; z-index: 1; border-color: #0366d6 }
.markdown-body .task-list-item+.task-list-item { margin-top: 3px }
.markdown-body .task-list-item input { margin: 0 .2em .25em -1.6em; vertical-align: middle }
.markdown-body hr { border-bottom-color: #eee }
.hljs { display: block; padding: .5em; color: #333; background: #f8f8f8 }
.diff .hljs-header,.hljs-comment { color: #998; font-style: italic }
.css .rule .hljs-keyword,.hljs-keyword,.hljs-request,.hljs-status,.hljs-subst,.hljs-winutils,.nginx .hljs-title { color: #333; font-weight: 700 }
.hljs-hexcolor,.hljs-number,.ruby .hljs-constant { color: teal }
.hljs-doctag,.hljs-string,.hljs-tag .hljs-value,.tex .hljs-formula { color: #d14 }
.hljs-id,.hljs-title,.scss .hljs-preprocessor { color: #900; font-weight: 700 }
.hljs-list .hljs-keyword,.hljs-subst { font-weight: 400 }
.hljs-class .hljs-title,.hljs-type,.tex .hljs-command,.vhdl .hljs-literal { color: #458; font-weight: 700 }
.django .hljs-tag .hljs-keyword,.hljs-rule .hljs-property,.hljs-tag,.hljs-tag .hljs-title { color: navy; font-weight: 400 }
.hljs-attribute,.hljs-name,.hljs-variable,.lisp .hljs-body { color: teal }
.hljs-regexp { color: #009926 }
.clojure .hljs-keyword,.hljs-prompt,.hljs-symbol,.lisp .hljs-keyword,.ruby .hljs-symbol .hljs-string,.scheme .hljs-keyword,.tex .hljs-special { color: #990073 }
.hljs-built_in { color: #0086b3 }
.hljs-cdata,.hljs-doctype,.hljs-pi,.hljs-pragma,.hljs-preprocessor,.hljs-shebang { color: #999; font-weight: 700 }
.hljs-deletion { background: #fdd }
.hljs-addition { background: #dfd }
.diff .hljs-change { background: #0086b3 }
.hljs-chunk { color: #aaa }
.mermaid .label { color: #333 }
.node circle,.node ellipse,.node polygon,.node rect { }
.edgePath .path { }
.edgeLabel { background-color: #e8e8e8 }
.cluster rect { }
.cluster text { }
.actor { }
text.actor { }
.actor-line { }
.messageLine0,.messageLine1 { }
#arrowhead { }
#crosshead path { }
.messageText { }
.labelBox { }
.labelText,.loopText { }
.loopLine { }
.note { }
.noteText { font-size: 14px }
.section { opacity: .2 }
.section0 { }
.section2 { }
.section1,.section3 { opacity: .2 }
.sectionTitle0,.sectionTitle1,.sectionTitle2,.sectionTitle3 { }
.sectionTitle { font-size: 11px }
.grid .tick { opacity: .3 }
.grid path { }
.today { }
.task { }
.taskText { font-size: 11px }
.taskTextOutsideRight { font-size: 11px }
.taskTextOutsideLeft { font-size: 11px }
.taskText0,.taskText1,.taskText2,.taskText3 { }
.task0,.task1,.task2,.task3 { }
.taskTextOutside0,.taskTextOutside1,.taskTextOutside2,.taskTextOutside3 { }
.active0,.active1,.active2,.active3 { }
.activeText0,.activeText1,.activeText2,.activeText3 { }
.done0,.done1,.done2,.done3 { }
.doneText0,.doneText1,.doneText2,.doneText3 { }
.crit0,.crit1,.crit2,.crit3 { }
.activeCrit0,.activeCrit1,.activeCrit2,.activeCrit3 { }
.doneCrit0,.doneCrit1,.doneCrit2,.doneCrit3 { cursor: pointer }
.activeCritText0,.activeCritText1,.activeCritText2,.activeCritText3,.doneCritText0,.doneCritText1,.doneCritText2,.doneCritText3 { }
.titleText { font-size: 18px }
.node text { font-size: 14px }
div.mermaidTooltip { position: absolute; text-align: center; max-width: 200px; padding: 2px; font-size: 12px; background: #ffffde; border: 1px solid #aa3; z-index: 100 }
body { margin: 0; padding: 0 }
.markdown-body { min-width: 256px; max-width: 978px; margin: 0 auto; padding: 20px; font-size: 14px }
.markdown-body h1 { font-size: 2.25em }
.markdown-body h2 { font-size: 1.75em }
.markdown-body h3 { font-size: 1.5em }
.markdown-body h4 { font-size: 1.25em }
.markdown-body h5,.markdown-body h6 { font-size: 1em }
div.mermaid { text-align: center }
hr.footnotes-sep { margin: 64px 0 32px; height: 1px }
.footnotes { font-size: 90%; padding-left: 16px }
li.footnote-item>p { margin: 8px 0 }
.danger,.info,.success,.warning { padding: 15px; margin-bottom: 20px; border: 1px solid transparent }
.danger>p:last-child,.info>p:last-child,.success>p:last-child,.warning>p:last-child { margin-bottom: 0 }
.success { color: #3c763d; background-color: #dff0d8; border-color: #d6e9c6 }
.info { color: #31708f; background-color: #d9edf7; border-color: #bce8f1 }
.warning { color: #8a6d3b; background-color: #fcf8e3; border-color: #faebcc }
.danger { color: #a94442; background-color: #f2dede; border-color: #ebccd1 }
abbr[title] { cursor: help; border-bottom: 1px dotted #777 }
ul.table-of-contents li { margin: 4px 0 }
.markdown-body table td,.markdown-body table th { }

TableView

当tableview的style为grouped的时候,会出现每个section之间有间距。

官方解析:Link on iOS 11, all estimated heights default to UITableViewAutomaticDimension Headers, footers, and cells use self-sizing by default.

- 解决方案:

如果开发者不想用这个新特性,可以在代理方法里面设置具体的高度,然后设置

tableView.estimatedRowHeight = 0
tableView.estimatedSectionHeaderHeight = 0
tableView.estimatedSectionFooterHeight = 0

TitleView

因为iOS11 的navbar的大标题和搜索栏的新特性,navbar的子视图发生了变化。 如果没有给出明确的长宽,就会出现Zero-size的出现,就是说titleview不见了,或者各种奇怪的事情出现。

- 解决方案:

  1. 给出指定的长宽,和子view设置好对应的约束。
  2. 或者重写intrinsicContentSize方法,设置成UILayoutFittingExpandedSize,让它自己自动扩展。
@available(iOS 6.0, *)
public let UIViewNoIntrinsicMetric: CGFloat

// Size To Fit

@available(iOS 6.0, *)
public let UILayoutFittingCompressedSize: CGSize
@available(iOS 6.0, *)
public let UILayoutFittingExpandedSize: CGSize

如果设置成扩展的话titleView和两边的item粘在一起了,所以需要做一下子视图的布局。

题外话: iOS6有一个API,systemLayoutSizeFitting,可以根据view的约束计算出对应的大小,具体可以看API文档。

Safe Area

这个主要影响用到mj的列表页面,和隐藏navbar的列表页面。

Safe Area是系统自己算的,系统会根据state bar的高度,navbar、tabbar是否透明(isTranslucent)。

每个view都有一个叫safeAreaInsets的属性(get only)。 如果开发者需要更改view的safe area 可以在controller设置additionalSafeAreaInsets去属性去弄。

例如:

带有navbar,和tabbar的页面。

controller.view.safeAreaInsets 为 UIEdgeInsets(top: 64.0, left: 0.0, bottom: 49.0, right: 0.0)

如果想改为(20,0,49,0)只需要做如下操作。

controller.view.additionalSafeAreaInsets = UIEdgeInsets(top: -44.0, left: 0.0, bottom: -49.0, right: 0.0)

其实无论设置成(-20000,0,0,0)也是最终得到的(20,0,49,0),还有就是无论设置bottom为-49还是其他的值,都无法抵消tabbar的高度,也就是说系统不允许我们去缩减bottom的值,可能是因为iPhoneX的底部虚拟home键。

view.safeAreaInsets是影响其子ScrollView的adjustedContentInset。 ScrollView会根据contentInsetAdjustmentBehavior属性去设置 adjustedContentInset。

public enum UIScrollViewContentInsetAdjustmentBehavior : Int {
    case automatic // Similar to .scrollableAxes, but for backward compatibility will also adjust the top & bottom contentInset when the scroll view is owned by a view controller with automaticallyAdjustsScrollViewInsets = YES inside a navigation controller, regardless of whether the scroll view is scrollable

    case scrollableAxes // Edges for scrollable axes are adjusted (i.e., contentSize.width/height > frame.size.width/height or alwaysBounceHorizontal/Vertical = YES)

    case never // contentInset is not adjusted

    case always // contentInset is always adjusted by the scroll view‘s safeAreaInsets
}
  1. UIScrollViewContentInsetAdjustmentAutomatic:如果scrollview在一个automaticallyAdjustsScrollViewContentInset = YES的controller上,并且这个Controller包含在一个navigation controller中,这种情况下会设置在top & bottom上 adjustedContentInset = safeAreaInset + contentInset不管是否滚动。其他情况下与UIScrollViewContentInsetAdjustmentScrollableAxes相同
  2. UIScrollViewContentInsetAdjustmentScrollableAxes: 在可滚动方向上adjustedContentInset = safeAreaInset + contentInset,在不可滚动方向上adjustedContentInset = contentInset;依赖于scrollEnabled和alwaysBounceHorizontal / vertical = YES,scrollEnabled默认为yes,所以大多数情况下,计算方式还是adjustedContentInset = safeAreaInset + contentInset
  3. UIScrollViewContentInsetAdjustmentNever: adjustedContentInset = contentInset
  4. UIScrollViewContentInsetAdjustmentAlways: adjustedContentInset = safeAreaInset + contentInset

- 使用MJ的列表页的适配方案

if #available(iOS 11, *) {
    t.contentInset.top += kTopBarHeight
    t.contentInset.bottom += kHomeBarHeight // 如果列表底部没有任何toolbar的需要添加,为了适配iPhone X
    t.contentInsetAdjustmentBehavior = .never
}

底层API命名改变

例如我使用一些第三方库的时候,它们有用到一些API如check_compile_time() 在iOS11里面的命名改变为__Check_Compile_Time()。

-解决方案:

找到对应的头文件,搜索旧的API一般都有说明的。

/*
 *	For time immemorial, Mac OS X has defined version of most of these macros without the __ prefix, which
 *	could collide with similarly named functions or macros in user code, including new functionality in
 *	Boost and the C++ standard library.
 *
 *  macOS High Sierra and iOS 11 will now require that clients move to the new macros as defined above.
 *
 *  If you would like to enable the macros for use within your own project, you can define the
 *  __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES macro via an Xcode Build Configuration.
 *  See "Add a build configuration (xcconfig) file" in Xcode Help.
 *
 *  To aid users of these macros in converting their sources, the following tops script will convert usages
 *  of the old macros into the new equivalents.  To do so, in Terminal go into the directory containing the
 *  sources to be converted and run this command.
 *
    find . -name ‘*.[c|cc|cp|cpp|m|mm|h]‘ -print0 |  xargs -0 tops -verbose \
      replace "check(<b args>)" with "__Check(<args>)"       replace "check_noerr(<b args>)" with "__Check_noErr(<args>)"       replace "check_noerr_string(<b args>)" with "__Check_noErr_String(<args>)"       replace "check_string(<b args>)" with "__Check_String(<args>)"       replace "require(<b args>)" with "__Require(<args>)"       replace "require_action(<b args>)" with "__Require_Action(<args>)"       replace "require_action_string(<b args>)" with "__Require_Action_String(<args>)"       replace "require_noerr(<b args>)" with "__Require_noErr(<args>)"       replace "require_noerr_action(<b args>)" with "__Require_noErr_Action(<args>)"       replace "require_noerr_action_string(<b args>)" with "__Require_noErr_Action_String(<args>)"       replace "require_noerr_string(<b args>)" with "__Require_noErr_String(<args>)"       replace "require_string(<b args>)" with "__Require_String(<args>)"       replace "verify(<b args>)" with "__Verify(<args>)"       replace "verify_action(<b args>)" with "__Verify_Action(<args>)"       replace "verify_noerr(<b args>)" with "__Verify_noErr(<args>)"       replace "verify_noerr_action(<b args>)" with "__Verify_noErr_Action(<args>)"       replace "verify_noerr_string(<b args>)" with "__Verify_noErr_String(<args>)"       replace "verify_string(<b args>)" with "__Verify_String(<args>)"       replace "ncheck(<b args>)" with "__nCheck(<args>)"       replace "ncheck_string(<b args>)" with "__nCheck_String(<args>)"       replace "nrequire(<b args>)" with "__nRequire(<args>)"       replace "nrequire_action(<b args>)" with "__nRequire_Action(<args>)"       replace "nrequire_action_quiet(<b args>)" with "__nRequire_Action_Quiet(<args>)"       replace "nrequire_action_string(<b args>)" with "__nRequire_Action_String(<args>)"       replace "nrequire_quiet(<b args>)" with "__nRequire_Quiet(<args>)"       replace "nrequire_string(<b args>)" with "__nRequire_String(<args>)"       replace "nverify(<b args>)" with "__nVerify(<args>)"       replace "nverify_string(<b args>)" with "__nVerify_String(<args>)"       replace "require_action_quiet(<b args>)" with "__Require_Action_Quiet(<args>)"       replace "require_noerr_action_quiet(<b args>)" with "__Require_noErr_Action_Quiet(<args>)"       replace "require_noerr_quiet(<b args>)" with "__Require_noErr_Quiet(<args>)"       replace "require_quiet(<b args>)" with "__Require_Quiet(<args>)"       replace "check_compile_time(<b args>)" with "__Check_Compile_Time(<args>)"       replace "debug_string(<b args>)" with "__Debug_String(<args>)"
 *
 */

参考文章

官方适配iOS11原文

译文

safe area

时间: 2024-08-01 00:58:47

为App适配iOS11的相关文章

你可能需要为你的APP适配iOS11

WeTest 导读 iOS 11 为整个生态系统的 UI 元素带来了一种更加大胆.动态的新风格. 本文介绍了iOS11在UI方面做了哪些更新,有些更新可以为用户提供更加完美的体验,但也有的可能会给目前的APP带来异常bug. 前言 前几天发现在做的APP在iOS11系统上动画有异常,在其他系统的设备上都是正常的,动画的操作是观察tableView的contentOffset变化后执行的,异常动画发生在tableView reloadData之后,也就是说tableView reloadData之

iOS开发——适配篇&amp;App适配简单概括

App适配简单概括 1:适配:适应.兼容各种不同的情况 系统适配 针对不同版本的操作系统进行适配 屏幕适配 针对不同大小的屏幕尺寸进行适配 在用户眼中 屏幕是由无数个像素组成的 像素越多,屏幕越清晰 在开发者眼中 屏幕是由无数个点组成的,点又是由像素组成的 像素越多,屏幕越清晰 iOS设置尺寸图 一:Autoresizing:基本的控件布局----掌握 在Autolayout之前,有Autoresizing可以作屏幕适配,但局限性较大,有些任务根本无法完成 相比之下,Autolayout的功能比

android客户端应用(native app)适配测试自动化 东海陈光剑 2014年5月5日 0:39:04

未命名 android客户端应用(native app)适配测试自动化 东海陈光剑 2014年5月5日 0:39:04 http://10.125.1.58:88/report.html?run_stamp=20140428054354&min=3&sec=214 <!doctype html><html><head>    <meta charset="UTF-8">    <title>适配测试报告<

Hybrid App适配Android注意点

最近把做好的ipad HTML5混合应用适配到android上,发现android的webview比 iPad差太多了,android4.4由于升级到chromium,和chrome内核一致,所有问题不多,但android4.3以下的版本兼容问题太多了,只能一个一个慢慢解决了! 目前已经碰到了css3 flex box布局的兼容问题, js的兼容问题等. Android的 css3 flex box需要这样写 .frame-page { display: -moz-box; /* Firefox

App适配iPhone 6/ Plus和iOS 8:10条小秘诀

(原文:raywenderlich 作者:Jack Wu 译者:@TurtleFromMars) 过节啦!为庆祝佳节,看看我给这篇文章写的这段极客小诗吧: “Keynote前夜,无人知晓,新API能否登场对Siri的期待,Touch ID的希望而此刻iOS 8应声而出,震惊全场扩展,Swift,Metal,整整一箩筐通用Storyboard,又有谁曾料想一片欢呼声中,有人开始迷惘现有的这些App,适配问题实在惆怅不过不必担心,因为这篇教程会与您讲讲新的API和屏幕尺寸,助你的App焕发容光遵循十

适配ios11 tableview的cell与状态栏的问题

最近在做适配ios11时发现tableview的cell初始位置是在状态栏下方,如图 如果想让cell起始位置置顶解决办法如下 //配置状态栏 if(@available(iOS 11.0, *)){ self.tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever; } else { self.automaticallyAdjustsScrollViewInsets = NO; }

Android P的APP适配总结,让你快人一步

欢迎大家前往腾讯云+社区,获取更多腾讯海量技术实践干货哦~ 本文由QQ音乐技术团队发表于云+社区专栏 上篇:Android P 行为变更适配 Android P 这次有很多行为变更,其中不乏一些需要亟需适配的变更. 一.全面屏检测 在 Android 8.0 时代各个手机厂商就开始发布自己的全面屏手机,但是此时 Android 官方并未支持到该功能,所以各个厂商都各自实现了一套全面屏判断逻辑,对于开发者来说甚是麻烦.终于在 Android P 里官方收归了该功能的判断逻辑,Android P 和

APP适配IOS8,iPhone6和Plus截图简要说明

有幸在9月25日拿到了iP6和iP6 Plus的真机,恰好又要做适配APP的工作(从iphone5上适配到iphone6和ip6 plus上),所以在真机上研究了下苹果官方在不同分辨率下对系统APP所做的适配.同时在网上也没找到相关的真机对比截图说明什么的,又有朋友问我要IP6和PLUS的真机截图回去自己研究,既然这样,那么干嘛不利用自己已有的资源,让更多的设计师受益呢?所以那就说点什么吧,抛砖引玉,希望大家可以共同研究,少走些弯路,共同成长. 之前看过@jingdesign 的关于适配ip6的

APP适配IOS8,iPhone6和Plus截图简要说明,有iP6截图下载供研究(转载)

有幸在9月25日拿到了iP6和iP6 Plus的真机,恰好又要做适配APP的工作(从iphone5上适配到iphone6和ip6 plus上),所以在真机上研究了下苹果官方在不同分辨率下对系统APP所做的适配.同时在网上也没找到相关的真机对比截图说明什么的,又有朋友问我要IP6和PLUS的真机截图回去自己研究,既然这样,那么干嘛不利用自己已有的资源,让更多的设计师受益呢?所以那就说点什么吧,抛砖引玉,希望大家可以共同研究,少走些弯路,共同成长. 之前看过@jingdesign 的关于适配ip6的