I have an ImageView sitting on a FrameLayout. I want to be able to move this imageView by setting a margin:
LayoutParams lp = new FrameLayout.LayoutParams(WRAP_CONTENT, WRAP_CONTENT);
lp.setMargins(left, top, 0, 0);
imageView.setLayoutParams(lp);
开发者_如何学PythonimageView.invalidate();
However nothing changes and my imageView does not move. What am I doing wrong? Do I need to be doing something different other than imageView.invalidate() after I set new margins?Try This ,I think it will work
FrameLayout.LayoutParams lp=new FrameLayout.LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT);
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论