V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
hualishu
V2EX  ›  Android

按百分比来适配屏幕

  •  
  •   hualishu · Feb 18, 2016 · 13257 views
    This topic created in 3730 days ago, the information mentioned may be changed or developed.

    I made a sample of the new percent support library.
    You can check official docs reference here and here.
    This library provide percentage based layouts, horizontal and vertical at the same time.

    代码部分

    Alt text

    Alt text

    代码部分

    hualishu
        1
    hualishu  
    OP
       Feb 18, 2016
    这个可以解决一些问题
    Tneciv
        2
    Tneciv  
       Feb 18, 2016
    不是有个官方的 support 包就是用来干这个的吗 ``com.android.support:percent``
    xxstop
        3
    xxstop  
       Feb 18, 2016
    mark...由于如此并没有考虑横屏!
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   953 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 19:35 · PVG 03:35 · LAX 12:35 · JFK 15:35
    ♥ Do have faith in what you're doing.