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

RecyclerView+fresco 设置圆角后滑动卡顿,怎么办?

  •  
  •   aliehuhu · Nov 4, 2018 · 12936 views
    This topic created in 2737 days ago, the information mentioned may be changed or developed.
    xml 里面设置的 fresco:roundedCornerRadius="10dp"
    3 replies    2018-11-04 13:50:39 +08:00
    SorcererXW
        1
    SorcererXW  
       Nov 4, 2018 via Android
    直接用 drawable 给 image 设置一个 corner background ?
    bkmi
        2
    bkmi  
       Nov 4, 2018 via Android
    你这个多半是错觉,圆角不是直接一次性设在 bitmap 上了嘛
    nicevar
        3
    nicevar  
       Nov 4, 2018   ❤️ 1
    你确定是设置圆角后卡顿的?
    复杂点你可以考虑直接抽象一个基类,在 dispatchDraw 里面裁剪 canvas 进行圆角处理,但是不要在 invalidateChildInParent、childDrawableStateChanged、refreshDrawableState 几个函数里标记重绘,否则部分设备上会出现性能问题,网上有些教程没有经过测试的
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2341 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 04:43 · PVG 12:43 · LAX 21:43 · JFK 00:43
    ♥ Do have faith in what you're doing.