iOS 开发实用技术导航
NSHipster 中文版
› http://nshipster.cn/
cocos2d 开源 2D 游戏引擎
› http://www.cocos2d-iphone.org/
CocoaPods
› http://cocoapods.org/
Google Analytics for Mobile 统计解决方案
› http://code.google.com/mobile/analytics/
WWDC
› https://developer.apple.com/wwdc/
Design Guides and Resources
› https://developer.apple.com/design/
Transcripts of WWDC sessions
› http://asciiwwdc.com
Cocoa with Love
› http://cocoawithlove.com/
Cocoa Dev Central
› http://cocoadevcentral.com/
NSHipster
› http://nshipster.com/
Style Guides
› Google Objective-C Style Guide
› NYTimes Objective-C Style Guide
Useful Tools and Services
› Charles Web Debugging Proxy
› Smore
clockwerk
V2EX  ›  iDev

请教一个 autolayout 的问题

  •  
  •   clockwerk · Oct 29, 2015 · 4472 views
    This topic created in 4024 days ago, the information mentioned may be changed or developed.

    中间的蓝色 uiview 的继承 class 为第三方的一个折线图,这个 view 用 autolayout 固定了高度,希望宽度适配屏宽,结果和想象的不一样,谁能指出问题关键点所在在哪里,不知道怎么组织关键字搜索
    http://ww4.sinaimg.cn/bmiddle/686c6057jw1exia8lrp65j210x0lo77c.jpg

    14 replies  •  2015-10-30 09:18:07 +08:00
    clockwerk
    clockwerk
    OP
    Oct 29, 2015
    1
    刚才图好像小了
    xenme
    xenme
    Oct 29, 2015
    2
    vulgur
    vulgur
    Oct 29, 2015
    3
    到两边的距离为 0 就可以了啊,两个约束
    loveuqian
    loveuqian
    Oct 29, 2015 via iPhone
    4
    希望宽度适配屏宽
    你要先说你做了什么完成这个啊
    zwo
    zwo
    Oct 29, 2015
    5
    似乎第三方控件不支持 autolayout ,在 5s 模拟器跑也是这种情况吗?
    anerevol
    anerevol
    Oct 29, 2015 via iPad
    6
    之前用 opengl 的 layer 好像也有类似的问题 代码里面手动布局好了
    clockwerk
    clockwerk
    OP
    Oct 30, 2015
    7
    @xenme 3q 把这个弄大了
    clockwerk
    clockwerk
    OP
    Oct 30, 2015
    8
    @zwo 5s 里面倒是正常,再大的屏宽就不行了,图表宽度一直会是 320
    clockwerk
    clockwerk
    OP
    Oct 30, 2015
    9
    @anerevol 那我就用代码布局下吧,本来想逃懒的。。。。。。
    clockwerk
    clockwerk
    OP
    Oct 30, 2015
    10
    @loveuqian 就把一个 uiview 扔到 sb 上,用 autolayout 适配宽度,然后让这个 uiview 的 class 继承第三方的类
    LSBs
    LSBs
    Oct 30, 2015
    11
    你这个折线图是有 x y 轴的吗? x 轴可以拖动不?
    clockwerk
    clockwerk
    OP
    Oct 30, 2015
    12
    @LSBs x 轴是不可以拖动的,具体功能 https://github.com/Jawbone/JBChartView
    zwo
    zwo
    Oct 30, 2015❤️1
    13
    @nellace 作者的 github 里面已经有人提了 issue ,还有解决办法,像这种多人用的开源库,你遇到的问题基本都会有人问。 https://github.com/Jawbone/JBChartView/issues/177
    clockwerk
    clockwerk
    OP
    Oct 30, 2015
    14
    @zwo 非常感谢,下次多读读 issue 了,
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1391 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 38ms · UTC 20:20 · PVG 04:20 · LAX 12:20 · JFK 15:20
    ♥ Do have faith in what you're doing.