I'm trying to create a custom layout that it automatically sets it's dimensions, height and width, according to the screen resolution. The reason I'm looking for such a behavior is that I want to add few of these custom layouts inside a HorizontalScrollView so that ea开发者_开发问答ch layout can fit perfectly inside the screen.
How can I approach getting and setting the proper dimensions on the custom layout view?
Thanks!
-Jona
Override onSizeChanged in your custom View:
@Override 
protected void onSizeChanged(int width, int height, int oldw, int oldh) {
  //do some calculations with width and height
}
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论