电竞一加 X 适配手机端 H5 页面通用解决方案

一:本文提供二种缓解方案

1,豆瓣相册https://github.com/TonnyTao/DoubanAlbum
2,voa在线芬兰语https://github.com/cubewang/NewsReader
3,电竞第一意见https://github.com/cubewang/GameDaily
4,开源中国的iOS客户端https://github.com/oschina/iphone-app
5,很优雅的部分零部件https://github.com/sobri909/MGBox2
6,ios控件学习:https://github.com/iimgal/StudyiOS?source=c
7,reader :https://github.com/vfr/Reader
8,git客户端:https://github.com/dennisreimann/ioctocat
9,speakEnglish:https://github.com/cubewang/SpeakEnglish❤❤❤❤❤❤❤❤克伟
10,音信阅读 :https://github.com/samuelclay/NewsBlur
11,last.fm:https://github.com/c99koder/lastfm-iphone
12,LBS游戏:https://github.com/Kjuly/iPokeMon
13,ThatInbox 是iOS平台上一个免费开源的Email
客户端:https://github.com/Ink/ThatInbox
14,ThatCloud是一个免费开源的iOS
app,允许你拜访、查看以及拔取你在网上存储的情节,可以很好地帮您做到工作:https://github.com/Ink/ThatCloud
15,ThatPhoto是选拔了Ink Mobile Framework框架来连续到任何iOS
应用程序,你可以用它来编排和保管照片:https://github.com/Ink/ThatPhoto
16,ThatPDF一个开源的,用来读书、签名和注释PDF
文档的工具:https://github.com/Ink/ThatPDF
17,xmpp聊天系统:https://github.com/chrisballinger/Off-the-Record-iOS
18,对口袋NCE有用的app:https://github.com/imtiger/HappyEnglish❤❤❤❤❤❤❤
19,一个像Instagram这样的图纸分享社区App:https://github.com/ParsePlatform/Anypic
20,黑客阅读:https://github.com/mmackh/Hacker-News-for-iOS
21,画图软件:https://github.com/sprang/Brushes❤❤❤❤❤❤
22,APN软件:https://github.com/lexrus/APN.iOS
23,Sol的天气app:https://github.com/comyarzaheri/Sol
24,货币转换:https://github.com/nicklockwood/Concurrency
25,来电归属地询问的软件(不可能上架):https://github.com/Quotation/WhoCall
26,Mogo iOS 客户端:https://github.com/jurre/Mogo-iOS
27,https://github.com/AshFurrow/C-41
28,使用XMPP协议的IM开源软件:https://github.com/chrisballinger/ChatSecure-iOS
29,WWDC:https://github.com/indragiek/WWDC-2014
30,移动支付公司 Square 将2018年收购的相片拔取 Viewfinder
开源了,包含服务端、iOS 和 Android
应用代码:https://github.com/viewfinderco/viewfinder
31,圣经小帮手 :https://github.com/nixzhu/Bible-Assistant
32,已阅 :https://github.com/ming1016/RSSRead
33,美国白宫APP:https://github.com/WhiteHouse/wh-app-ios
34,Ruby for China:https://github.com/ruby-china/ruby-china-for-ios
35,breadwallet iOS bitcoin wallet
https://github.com/voisine/breadwallet
36,品趣:https://github.com/novel-design/novel-design
37,懒人笔记:https://github.com/liaojinxing/Voice2Note
38, Doppio :https://github.com/chroman/Doppio
—————-开源项目标磋商————–
天涯论坛音信的开源协议:http://m.163.com/special/newsclient/ios_libraries.html
—————-组件—————-
自定义tabbar(1)的:https://github.com/i300/TweetBotTabBar
自定义tabbar(2)和上拉刷新:http://www.cocoachina.com/bbs/read.php?tid=62061&keyword=tabbar
自定义tabbar(3):https://github.com/jinthagerman/JBTabBarController
类似instagram的tabbar:https://github.com/boctor/idev-recipes/tree/master/CustomTabBarNotification
coretext:https://github.com/Cocoanetics/DTCoreText
图表延时加载:http://developer.apple.com/library/ios/#samplecode/LazyTableImages
网络请求:https://github.com/pokeb/asi-http-request
https://github.com/AFNetworking/AFNetworking
Json解析:https://github.com/johnezang/JSONKit
图片异步加载:https://github.com/rs/SDWebImage?source=c
瀑布流1):https://github.com/aceisScope/WaterflowView
瀑布流2)http://code4app.com/ios/%E7%80%91%E5%B8%83%E6%95%88%E6%9E%9C-%E4%B8%8D%E5%90%8C%E7%9A%84%E5%AE%9E%E7%8E%B0%E6%96%B9%E5%BC%8F/4fdfecd96803fa117f000000
瀑布流3):https://github.com/chiahsien/CHTCollectionViewWaterfallLayout❤❤❤❤❤❤❤
瀑布流4):http://www.cocoachina.com/bbs/read.php?tid=94851&keyword=%C6%D9%B2%BC%C1%F7
瀑布流5):https://github.com/ptshih/PSCollectionView❤❤❤❤❤❤❤❤❤❤
瀑布流6):http://www.cocoachina.com/bbs/search.php?ss=index#submit搜索:瀑布流
瀑布流7):https://github.com/steipete/PSTCollectionView
做图书的一个框架:https://github.com/Simbul/baker
项目内文档:https://github.com/tomaz/appledoc?source=c
抽屉导航:https://github.com/Inferis/ViewDeck
iOS的url router :https://github.com/gaosboy/urlmanager
https://github.com/usepropeller/routable-ios
https://github.com/jverkoey/sockit
照片墙:https://github.com/gmoledina/GMGridView
collectionview:https://github.com/steipete/PSTCollectionView
自行更新类:https://github.com/lexrus/LTUpdate
官网蝴蝶的OpenGL应用:https://developer.apple.com/library/ios/\#documentation/UIKit/Reference/UITabBar\_Class/Reference/Reference.html\#//apple\_ref/doc/uid/TP40007521-CH3-SW4
开机密码锁:https://github.com/aporat/KKPasscodeLock
录像播放器:https://github.com/blizzard-op/VideoPlayerKit
旋律播放完整客户端:https://github.com/kstenerud/ObjectAL-for-iPhone
豆类音频播放:https://github.com/douban/DOUAudioStreamer❤❤❤❤❤
掉渣天的音频播放流:https://github.com/alexbw/novocaine
AudioEngine:https://github.com/TheAmazingAudioEngine/TheAmazingAudioEngine1000+❤
滑动的自定义的SegmentedControl控件:https://github.com/samvermette/SVSegmentedControl
自定义的segmented:https://github.com/HeshamMegid/HMSegmentedControl
恍如swipelist的左右滑动的cell:https://github.com/alikaragoz/MCSwipeTableViewCell❤❤❤❤❤
扩展1:https://github.com/soffes/sstoolkit❤❤❤❤
增加2:(存用户密码):https://github.com/soffes/sskeychain❤❤❤❤
scrollview自动滚动:https://github.com/shanegao/SGFocusImageFrame
scrollview左右滑动,渐隐渐出:https://github.com/park0ur/Path-Intro-iPhone
scrollview滑动条变细:https://github.com/r-plus/ScrollThindicator
弹窗层:https://github.com/martinjuhasz/MJPopupViewController❤❤❤❤❤
tableview下拉图形放大:https://github.com/hunk/TwProfile
挑选iPod库播放音乐:https://github.com/gangverk/GVMusicPlayerController
UIView动画:https://github.com/neror/ftutils
仿佛clear的超强动画cell:https://github.com/mystcolor/JTGestureBasedTableViewDemo
果壳网消息背景图浮动:https://github.com/kenshin03/Home-For-iOS
仿果壳网,新浪的push效果,带有阴影:1)http://code4app.com/ios/%E8%A7%86%E5%9B%BE%E5%88%87%E6%8D%A2%E5%A4%A7%E5%B0%8F%E6%B8%90%E5%8F%98%E6%95%88%E6%9E%9C/5124399a6803fae82c000000
2)https://github.com/vinqon/MultiLayerNavigation
3)https://github.com/chisj/EuPopDemo
❤❤❤❤❤实现原理:http://mobile1.riaos.com/?p=2025414❤❤❤❤❤
天涯论坛知乎和情人圈的图片浏览情势:
1)https://github.com/Seitk/FB-Gallery
2)https://github.com/jimneylee/SinaMBlogNimbus
coretext 运用:https://github.com/akosma/CoreTextWrapper
N多自定义组件:https://github.com/boctor/idev-recipes❤❤❤❤❤❤
能够换图片的pageControl:https://github.com/Spaceman-Labs/SMPageControl
瀑布流:https://github.com/ptshih/PSCollectionView
iOS7的扁平UI:https://github.com/Grouper/FlatUIKit
产品辅导view:https://github.com/123nobody/WZGuideViewController
类似safari的页面浏览:https://github.com/100grams/HGPageScrollView❤❤❤❤❤❤
正则匹配UIView
https://github.com/KayK/RegexHighlightView❤❤❤❤❤❤❤❤❤❤❤❤
加密艺术:https://github.com/dev5tec/FBEncryptor
https://github.com/mayurbirari/AES256AndBase64
自增长的键盘:https://github.com/HansPinckaers/GrowingTextView
自定义的map Annotation
:https://github.com/grgcombs/MultiRowCalloutAnnotationView
超屌的3d画面:https://github.com/nicklockwood/iCarousel❤❤❤❤❤❤❤❤❤❤❤❤
上拉刷新 :https://github.com/dbsGen/SlimeRefresh
翻页效果:https://github.com/brow/leaves
恍如maps的一半翻页:https://github.com/FairfaxMobile/FDCurlViewControl
弹窗:https://github.com/martinjuhasz/MJPopupViewController
对话框:https://github.com/jessesquires/MessagesTableViewController
pagecurl的翻页效果:http://www.cocoachina.com/bbs/read.php?tid=11856&keyword=%B5%D8%CD%BC
二维码:http://www.cocoachina.com/applenews/devnews/2013/0104/5462.html
自定义的annotation(1):https://github.com/applidium/ADClusterMapView
自定义的annotation(2):http://code4app.com/ios/Customized-Complex-Map-Annotation/4f67f4f86803fa843f000002#osc
恍如国家地理的翻页:https://github.com/michaelhenry/MHNatGeoViewControllerTransition
iOS开发私有库:https://github.com/kennytm/iphone-private-frameworks
viewController的切换(从右边进来):https://github.com/steipete/PSStackedView❤❤❤❤❤❤❤❤❤❤❤❤
平安存储用户名,密码等:https://github.com/granoff/Lockbox
FormSheet的神器:https://github.com/m1entus/MZFormSheetController
iOS中model类的写法:https://github.com/github/Mantle
相关介绍:https://github.com/blog/1299-mantle-a-model-framework-for-objective-c
model类解析:https://github.com/nicklockwood/BaseModel
basemodel解析:https://github.com/andrep/RMModelObject
蓝牙:https://github.com/xuanhuangyiqi/Anti-Lost
model类相比较好的库1):https://github.com/icanzilb/JSONModel
model类相比好的库2):https://github.com/github/Mantle
原生App的长途调试工具包:https://github.com/square/PonyDebugger#remote-logging
将缓存存在磁盘:https://github.com/rs/SDURLCache
path的欢迎页实现形式:https://github.com/icepat/ICETutorial❤❤❤❤❤❤❤❤❤
path的左下角菜单栏的同类实现形式:https://github.com/mattgemmell/MGTileMenu
coredata的封装库:https://github.com/magicalpanda/MagicalRecord❤❤❤❤❤❤
coredata的 sql使用办法:https://github.com/marcoarment/FCModel
zip文件解压缩:https://github.com/soffes/ssziparchive
完善的图片category:https://github.com/Nyx0uf/NYXImagesKit
纵向的scrollview循环利用:https://github.com/andreyvit/SoloComponents-iOS
UINavigationController的push可能导致错误的效果的补给:https://github.com/Plasma/BufferedNavigationController
UIKit的分类:https://github.com/enormego/cocoa-helpers❤❤❤❤❤ ❤❤❤❤❤
左右轮转的scrollview(类似新浪读图):https://github.com/kejinlu/PagedFlowView
webview控制器:https://github.com/samvermette/SVWebViewController
滑动帧动画:https://github.com/IFTTT/JazzHands❤❤❤❤❤
iOS6的水滴下拉刷新:https://github.com/Sephiroth87/ODRefreshControl
微信下拉展现logo:https://github.com/gluttony/RevealLogo
支付宝的锁屏界面:https://github.com/kejinlu/KKGestureLockView
status
bar的离线loading效果:http://www.cocoachina.com/bbs/read.php?tid=99947&keyword=%CD%F8%D2%D7
如法炮制百度地图向下推的层:https://github.com/mariohahn/MHDismissModalView
FileManager:https://github.com/nicklockwood/StandardPaths
下拉头图放大:https://github.com/cyndibaby905/TwitterCover
(1)访知乎的左右滑行的view:http://code4app.com/ios/%E4%BB%BF%E7%BD%91%E6%98%93%E6%96%B0%E9%97%BB%E7%9A%84%E6%BB%91%E5%8A%A8%E8%A7%86%E5%9B%BE%E5%B8%83%E5%B1%80/5255fbd96803fa8660000000
(2)左右横向滑动:https://github.com/MugunthKumar/MKHorizMenuDemo
tableview模仿path的时间表:https://github.com/kentnguyen/KNPathTableViewController
弹出层:https://github.com/50pixels/FPPopover
二维码登录:https://tiqr.org/
弹出层:https://github.com/UrbanApps/UAModalPanel
非死不可paper中的图片左右活动实现:https://github.com/chroman/CRMotionView
横向滚动的tab1):https://github.com/pppoe/LightMenuBar
横向滚动的tab2):https://github.com/MugunthKumar/MKHorizMenuDemo
反正滑动的cell,有删除等功能:https://github.com/CEWendel/SWTableViewCell/
今非昔比速度的scrollview,用于做启动介绍页:https://github.com/5sw/SWParallaxScrollView
mattt写的解析html和xml的:https://github.com/mattt/Ono
由此服务器动态修改客户端逻辑:https://github.com/mmin18/WaxPatch
routes,可以让按钮间接向点html的链接一样:https://github.com/joeldev/JLRoutes
像博客园乐乎同样的图形浏览viewcontroller:https://github.com/jaredsinclair/JTSImageViewController
像微信一模一样的search bar
https://github.com/fabiankr/TableViewSearchBar
图形浏览:https://github.com/EddyBorja/EBPhotoPages
左滑动或右滑动cell:https://github.com/modocache/MDCSwipeToChoose
好像iOS相册删除照片的卡通效果:https://github.com/Ciechan/BCGenieEffect
扁平化的uibutton:https://github.com/barbosa/GBFlatButton
给app评分的机件1:https://github.com/nicklockwood/iRate
给app评分的零件2:https://github.com/arashpayan/appirater
NSFileManager的封装:https://github.com/fabiocaccamo/FCFileManager
paper的点击展开效果:https://github.com/hebertialmeida/HAPaperViewController
柱状图:https://github.com/honcheng/iOSPlot
点击titleview弹出下拉的menu:https://github.com/romaonthego/REMenu
自定义开场图:https://github.com/ealeksandrov/EAIntroView
让navbar跟着scrollview一起滚动:https://github.com/andreamazz/AMScrollingNavbar
跟相册相关的:https://github.com/B-Sides/ELCImagePickerController
更高速的显得地图上的大头针:https://github.com/choefele/CCHMapClusterController
streaming的音频播放:https://github.com/douban/DOUAudioStreamer
XMPP的使用:https://github.com/adow/Dollarss
iOS7
mailbox的statusbar运用:https://github.com/simonholroyd/StatusBarTest
江山地理的页面切换动画:https://github.com/michaelhenry/MHNatGeoViewControllerTransition
引导页1:https://github.com/MatthewYork/MYBlurIntroductionView
引导页2:https://github.com/MatthewYork/iPhone-IntroductionTutorial
引导页3:https://github.com/ealeksandrov/EAIntroView
iOS7的电话button:https://github.com/mrcrow/MRoundedButton
仿佛paper的导航抖动:https://github.com/andreamazz/AMWaveTransition
下拉填充满字体:https://github.com/d-ronnqvist/blogpost-codesample-PullToRefresh:
gif播放 :https://github.com/Flipboard/FLAnimatedImage
视图切换:https://github.com/zoonooz/ZFDragableModalTransition
看似游戏的菜谱按钮,点击伸缩:https://github.com/sendoa/QBKOverlayMenuView
模仿twitter的首页左右切换:https://github.com/duowan/TwitterPaggingViewer
下载器:https://github.com/thibaultCha/TCBlobDownload
天涯论坛快讯的离线下载bar:https://github.com/jaydee3/JDStatusBarNotification
图片剪切和拆剪:https://github.com/kishikawakatsumi/PEPhotoCropEditor
过度效果的status bar :https://github.com/nrj/AlphaGradientStatusBar
非死不可’s paper的弹出层:https://github.com/UrbanApps/UAModalPanel
Objective-C 和JavaScript
交互:https://github.com/marcuswestin/WebViewJavascriptBridge
CollectionView in
UITableViewCell:https://github.com/AshFurrow/AFTabledCollectionView
popview(1):https://github.com/jmascia/KLCPopup
popview(2)https://github.com/andreamazz/AMPopTip
UICollectionView replacement of UITableView
(添加上section):https://github.com/jamztang/CSStickyHeaderFlowLayout
storekit:https://github.com/mattt/CargoBay
========================== UICollectionView相关===============
https://github.com/bryceredd/RFQuiltLayout
==========================helper相关===============
https://github.com/andrewroycarter/UIView-Helpers
==========================auto layout相关=======
https://github.com/cloudkite/Masonry
https://github.com/smileyborg/UIView-AutoLayout
https://github.com/iMartinKiss/KeepLayout
pinterst的下拉刷新填充满的效应:https://github.com/uzysjung/UzysCircularProgressPullToRefresh
==========================block相关=======================================
https://github.com/jivadevoe/UIAlertView-Blocks
https://github.com/pandamonia/BlocksKit❤❤❤❤❤
==========================iOS7相关=======================================
iOS7颜色类:https://github.com/claaslange/iOS7Colors
iOS7:动态毛玻璃效果:https://github.com/alexdrone/ios-realtimeblur
iOS7 blur侧边栏:https://github.com/rnystrom/RNFrostedSidebar
iOS7 blur image:https://github.com/lukabernardi/LBBlurredImage
iOS7 blur 效果:https://github.com/nicklockwood/FXBlurView
iOS7的uialertview:https://github.com/alexanderjarvis/PXAlertView
边打字边出现标题:https://github.com/jverdi/JVFloatLabeledTextField
扁平化的segment:https://github.com/pepibumur/PPiFlatSegmentedControl
iOS7视图切换炫酷效果:https://github.com/ColinEberhardt/VCTransitionsLibrary
iOS7教学代码:https://github.com/ShinobiControls/iOS7-day-by-day
iOS7品格的抽屉导航:https://github.com/monospacecollective/MSDynamicsDrawerViewController
颜色渐变的加载:https://github.com/nrj/GradientProgressView
电竞,iOS7demo:https://github.com/shu223/iOS7-Sampler
iOS正则分类:https://github.com/bendytree/Objective-C-RegEx-Categories
iOS7侧边栏:https://github.com/romaonthego/RESideMenu
iOS7侧边栏(覆在view上)https://github.com/romaonthego/REFrostedViewController
iOS7库:https://github.com/youknowone/UI7Kit(可以让iOS5也有iOS7的样子)
===========================测试框架=====
http://www.cocoachina.com/applenews/devnews/2013/1025/7242.html
https://github.com/kif-framework/KIF

1.巅峰解决方案(最优,提议采纳)

笔者:赫格托尔
链接:http://www.jianshu.com/p/f607bf3b5614
來源:简书
作品权归作者所有。商业转载请联系作者得到授权,非商业转载请表明出处。

2.web缓解方案

 

导语: 红米X的出现,一方面对于一切手机行业的上扬极具改进领头羊的效用,另一方面也对现有业务的页面适配带来了新的挑战。
对于手Q中的各业务以来,受HTCX影响的H5页面挺多,应该使用怎么着快捷有效的主意来应对吧?

 

最近的H5页面可以分为通栏页面和非通栏页面二种,每种页面都可能有底部操作栏,具体如下:

 

通栏页面

 

顶部通栏

 

少数事情的一流页面多数采纳了顶部通栏banner的职能,由于BlackBerryX在状态栏增添了24px的可观,对于前几日通栏banner规范的内容区域会有遮挡情况。

 

解决方案:对于通栏页面在页面顶部扩充一层低度44px的黑色适配层,整个页面往下挪44px。

 

那种做法固然不相符苹果要求的设计规范,但由于长期内更新任何banner的基金太高,可以先这么概括处理,后续再优化banner的筹划展现。

 

电竞 1

 

                  底部Tab栏/操作栏

 

些微页面使用了底层Tab栏/操作栏,由于HTCX去掉了底部Home键,取而代之是34px中度的Home Indicator
,对于眼前的底层Tab栏/操作栏会促成一定的阻拦。

 

解决方案:在页面底部扩张一层低度34px的适配层,将操作栏上移34px,颜色可以自定义。

 

电竞 2

 

 

非通栏页面

 

底部Tab栏/操作栏

 

缘由同上,在底部有34px低度的Home Indicator
,对于当前的平底Tab栏/操作栏会造成一定的阻止操作。

 

釜底抽薪方案:在页面底部扩大一层低度34px的颜料块,将操作栏上移34px,颜色能够自定义。

 

电竞 3电竞 4

 

 

至于安全区域

 

这边可能有人会有问题,为啥非通栏下的页面内容是通到底部的,而按钮却是在安全区域上方呢?

 

以此问题提到到安全区域,iOS11 和原先版本的不同之处在于,webview
相比较重视安全区域了。这表示,固然给页面元素设置 top: 0,
它会渲染在屏幕顶部的44px之下,也就是场馆栏上面。假若给页面元素设置
bottom: 0, 它会渲染在屏幕底边的34px之上,也就是底层安全区域方面。

 电竞 5

 

电竞 6

 

为领悟决这一个两难的意况,苹果公司给大家提供了一个装置viewport的meta标签的缓解方案。

 <meta name=”viewport” content=”width=device-width, initial-scale=1.0,
viewport-fit=cover”>

viewport 可以安装的选项就是 viewport-fit,它有多少个可选值:

 

  • contain: The viewport should fully contain the web content.
    可视窗口完全包含网页内容

  • cover: The web content should fully cover the viewport.
    网页内容完全覆盖可视窗口

  • auto: The default value, 同contain的作用

 

透过给页面设置viewport-fit=cover,能够将页面的布局区域延伸到页面顶部和底部。

 

电竞 7电竞 8

 

 

对此通栏页面,设置了viewport-fit的性能,发现会不见效,经过跟同事查看手Q源码后意识,终端对于WebView通栏的场所设置了UIScrollViewContentInsetAdjustmentNever属性,去除了上下安全区域的边距,使得安全区域的左左边距失效了。

 

除此以外提一点,经过2个本子的webview测试,发现WKWebView在渲染页面的时候,底部按钮在地点表现上不雷同,可能是一个还未缓解的bug:

 电竞 9

 

电竞 10

 

使用web方案:

 

遵照以上的设计方案,可以这么处理:

 

  1. 修改页面viewport-fit属性

  2. 在H5页面链接一个iphonex.css来给摩托罗拉 X访问的页面扩展对应的适配层

  3. 在H5页面上给相应的dom结构充分适配的类名

 

iphonex.css

 

@media only screen and class=”Apple-converted-space”> (device-width: class=”Apple-converted-space”> 375px) class=”Apple-converted-space”> and class=”Apple-converted-space”> (device-height: class=”Apple-converted-space”> 812px) class=”Apple-converted-space”> and

(-webkit-device-pixel-ratio: class=”Apple-converted-space”> 3) class=”Apple-converted-space”> {

    /*日增头部适配层*/

    .has-topbar {

        height: 100%;

        box-sizing: class=”Apple-converted-space”> border-box;

        padding-top: 44px;

        &:before {

            content: ”;

            position: class=”Apple-converted-space”> fixed;

            top: 0;

            left: 0;

            width: 100%;

            height: 44px;

            background-color: class=”Apple-converted-space”> #000000;

            z-index: 9998;

        }

    }

 

    /*增添底部适配层*/

    .has-bottombar {

        height: 100%;

        box-sizing: class=”Apple-converted-space”> border-box;

        padding-bottom: class=”Apple-converted-space”> 34px;

        &:after {

            content: ”;

            z-index: 9998;

            position: class=”Apple-converted-space”> fixed;

            left: 0;

            bottom: 0;

            width: 100%;

            height: 34px;

            background: class=”Apple-converted-space”> #f7f7f8;

        }

    }

 

    /*导航操作栏上移*/

    .bottom-menu-fixed {

        bottom: 34px;

    }

}

 

<!DOCTYPE HTML>

<html class=”has-topbar
has-bottombar”>

<head>

    <meta charset=”utf-8″>

    <meta class=”Apple-converted-space”> name=”format-detection” class=”Apple-converted-space”> content=”telephone=no” class=”Apple-converted-space”> />

    <meta http-equiv=”x-dns-prefetch-control” class=”Apple-converted-space”> content=”on”>

    <meta name=”viewport” class=”Apple-converted-space”> content=”width=device-width,initial-scale=1.0,user-scalable=no” class=”Apple-converted-space”> />

    <meta class=”Apple-converted-space”> name=”apple-mobile-web-app-capable” class=”Apple-converted-space”> content=”yes” class=”Apple-converted-space”> />

    <meta class=”Apple-converted-space”> name=”apple-mobile-web-app-status-bar-style” class=”Apple-converted-space”> content=”black” class=”Apple-converted-space”> />

    <link rel=”stylesheet” class=”Apple-converted-space”> type=”text/css” class=”Apple-converted-space”> href=”../../css/index.v6/index.css”>

    <link rel=”stylesheet” class=”Apple-converted-space”> href=”../../css/index.v6/iphonex.css”>

    <title>游戏为主</title>

</head>

 

<body class=”body-index ” ontouchstart=””>

<ul class=”ui-tiled bottom-menu bottom-menu-fixed” >

    <li class=””>

        <i class=”gc-icon-normal gc-icon-find” ></i>

        <div class=”Apple-converted-space”> class=”txt”>游戏</div>

    </li>

     <li class=””>

        <i class=”gc-icon-normal gc-icon-live” ></i>

        <div class=”Apple-converted-space”> class=”txt”>直播</div>

    </li>

    <li class=””>

        <i class=”gc-icon-normal gc-icon-compete” ></i>

        <div class=”Apple-converted-space”> class=”txt”>赛事</div>

    </li>

    <li class=””>

        <i class=”gc-icon-normal gc-icon-original” ></i>

        <div class=”Apple-converted-space”> class=”txt”>电竞圈</div>

    </li>

    <li class=”Apple-converted-space”> class=”marker”></li>

</ul>

</body>

</html>

 

如上,这样做的题材是,要修改的页面相当多,而且给页面带来了附加的类名,对今后的体制移除也有肯定的工作量。

 

既然如此使用web的法门来解决这些题材不是很系数,是否足以经过终点的章程给webview增添适配层,从而缓解那些题材啊?

 

运用极限方案:

 

由此跟终端同学的互换,确定是可以通过终端的办法,针对金立X机型,在原生界面初阶化的时候可选拔是否要追加适配层,这样页面就不需要样式处理了。

 

具体是经过链接中追加参数来拓展适配:

 

电竞 11电竞 12

 

 

对此顶部通栏的页面,通过加URL参数来扩充顶部红色适配层。http://m.gamecenter.qq.com/directout/index?\_bid=278&\_wvx=1

 

电竞 13电竞 14

 

 

对于有底部操作栏(包括通栏和非通栏),通过加URL参数来扩展底部适配层以及安装颜色。

http://m.gamecenter.qq.com/directout/index?\_bid=278&\_wvx=10&\_wvxBclr=0xf7f7f8

 

(这里的wvx=10为2和8六个性状数字相加)

 

电竞 15

 

 

这么,无需写一行代码,只需要给页面链接扩大适配参数,就足以周全适配摩托罗拉X了~

 

今后的头部优化未来,也可以透过参数配置去掉近期的顶部肉色适配层

 

更多具体技术实现可以查看这里:

 

https://ayogo.com/blog/ios11-viewport/

 

发表评论

电子邮件地址不会被公开。 必填项已用*标注