iOS11AdaptationTips
iOS11AdaptationTips copied to clipboard
iOS 11 tableView for header in xib !
Summary
使用 xib 创建 tableView 的 header 的时候出现缺少20的距离
How would you classify this issue?
Choose a problem area with iOS SDK:
- [ ] Foundation
- [x] UIKit
- [ ] Core Location
- [ ] Keyboard
- [ ] CFNetwork Framework
- [ ] AVFoundation
- [ ] iTunes Connect
- [ ] App Store
- [ ] Accelerate Framework
- [ ] Accounts Framework
- [ ] App Switcher
- [ ] Audio
- [ ] Audio Toolbox
- [ ] AVKit
- [ ] Calendar
- [ ] CallKit
- [ ] Cellular Service (Calls / Data)
- [ ] CloudKit
- [ ] Contacts
- [ ] Contacts Framework
- [ ] Control Center
- [ ] Core Animation
- [ ] Core Bluetooth
- [ ] Core Data
- [ ] Core Foundation
- [ ] Core Graphics
- [ ] Core Image
- [ ] Core Media
- [ ] Core Motion
- [ ] Core Spotlight
- [ ] Core Telephony Framework
- [ ] Core Video
- [ ] CoreML
- [ ] EventKit
- [ ] External Accessory Framework
- [ ] GameplayKit
- [ ] GLKit
- [ ] HealthKit
- [ ] HomeKit
- [ ] Image I/O
- [ ] Intents Framework
- [ ] IOKit
- [ ] Local Authentication Framework
- [ ] Something not on this list
Base Information for this issue
-
iOS System Version:iOS 11 beta
-
Language:
- [x] Objective-C
- [x] Swift
-
Prototype(是否是真机)
- [x] YES
- [ ] NO
-
Test devices:
-
[ ] iPhone 7
-
[ ] iPhone 7 Plus
-
[ ] iPhone SE, iPhone 5s
-
[x] iPhone 6s, iPhone 6
-
[x] iPhone 6s Plus, iPhone 6 Plus
-
[ ] iPad Pro (10.5-inch), iPad Pro (12.9-inch) (2nd generation)
-
[ ] iPad (9.7-inch), iPad mini 4, iPad Air 2, iPad mini 3
-
[ ] iPad Pro (9.7‑inch)
-
[ ] iPad Pro (12.9‑inch)
-
[ ] iPad Air, iPad mini 2
-
[ ] iPod touch (6th generation)
-
-
What kind of issue are you reporting?
- [x] Q-A
- [ ] Crash
- [x] Bug
What steps can we take to reproduce this issue?
Steps to Reproduce:
使用 xib 创建 tableView 的 header 的时候出现缺少20的距离, 如图:
(白色区域就是添加的 header 明显上边少了20 point)
(效果图)
How to solve ?
Here is a Demo.
Same questions on Stack OverFlow
no same questions
降级到iOS10.3.2无法使用备忘录,播客等app。
我reveal看了一下,添加在控制器的View的第一层视图(如tableView或者scrollView),它的frame和bounds不一样,如(frame:0,0,w,h;bounds:0,-20,w,h),目前预备最简单粗暴方案是设置inset 将top设置为-20,再查看frame和bounds是一样的(0,0,w,h)。
This Problem is arises on iOS11
interesting
try contentInsetAdjustmentBehavior
我也遇到了,我滑动 tableView 的时候改变headerView 的上面背景图片的 frame,但是顶部会有问题。
Could someone please explain how this issue was solved?
This should answer your question http://www.jianshu.com/p/efbc8619d56b