How to set GridView not to scroll
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!