aliehuhu
V2EX  ›  Android

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

  •  
  •   aliehuhu · Nov 4, 2018 · 13865 views
    This topic created in 2940 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
    SorcererXW
    Nov 4, 2018 via Android
    1
    直接用 drawable 给 image 设置一个 corner background ?
    bkmi
    bkmi
    Nov 4, 2018 via Android
    2
    你这个多半是错觉,圆角不是直接一次性设在 bitmap 上了嘛
    nicevar
    nicevar
    Nov 4, 2018❤️1
    3
    你确定是设置圆角后卡顿的?
    复杂点你可以考虑直接抽象一个基类,在 dispatchDraw 里面裁剪 canvas 进行圆角处理,但是不要在 invalidateChildInParent、childDrawableStateChanged、refreshDrawableState 几个函数里标记重绘,否则部分设备上会出现性能问题,网上有些教程没有经过测试的
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1127 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 23:50 · PVG 07:50 · LAX 15:50 · JFK 18:50
    ♥ Do have faith in what you're doing.