Android ViewGroup.setScaleX() cause the view to be clipped

前端 未结 5 1090
鱼传尺愫
鱼传尺愫 2021-01-02 14:21

I use NineOldAndroids library to scale my custom layout.

public class MyLayout extends FrameLayout {
  // LayoutParams.MATCH_PARENT and all.
  ...
  @Overrid         


        
5条回答
  •  醉梦人生
    2021-01-02 15:22

    Since API Level 11, the View class has setScaleX() and setScaleY() methods, that work as expected and also scale sub-views of the scaled view. So, if that'd be a way for you, drop the library and just do

    v.setScaleX(mScale);
    v.setScaleY(mScale);
    

提交回复
热议问题