Get the App
SLTechnology News&Howtos  ›  Development  › 

How to set GridView not to scroll

Shulou Source: shulou.com Published: 2022-06-03 07:31:51 11月15日 Update

This article introduces the knowledge of "how to set GridView not to scroll". In the operation of actual cases, many people will encounter such a dilemma. Next, let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Class MyGridView extends GridView {public MyGridView (android.content.Context context, android.util.AttributeSet attrs) {super (context, attrs);} / * set not to scroll * / public void onMeasure (int widthMeasureSpec, int heightMeasureSpec) {int expandSpec = MeasureSpec.makeMeasureSpec (Integer.MAX_VALUE > > 2, MeasureSpec.AT_MOST) Super.onMeasure (widthMeasureSpec, expandSpec);}} "how to set GridView not to scroll" ends here. Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Tags: Content more knowledge practical successful learning next dilemma reality situation article case editing website industry process high quality learning related output Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB Shulou Information Redmi macOS vpn