Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <NestedScrollView>
- <LinearLayout>
- <LinearLayout></LinearLayout>
- ... // About 3 of the LinearLayouts
- <ExpandableListView/>
- </LinearLayout>
- </NestedScrollView>
- @Override
- public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
- int heightMeasureSpec_custom = MeasureSpec.makeMeasureSpec(
- Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST);
- super.onMeasure(widthMeasureSpec, heightMeasureSpec_custom);
- ViewGroup.LayoutParams params = getLayoutParams();
- params.height = getMeasuredHeight();
- }
- public class NonScrollExpandableListView extends ExpandableListView {
- public NonScrollExpandableListView(Context context) {
- super(context);
- }
- public NonScrollExpandableListView(Context context, AttributeSet attrs) {
- super(context, attrs);
- }
- public NonScrollExpandableListView(Context context, AttributeSet attrs, int defStyle) {
- super(context, attrs, defStyle);
- }
- @Override
- public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
- int heightMeasureSpec_custom = MeasureSpec.makeMeasureSpec(
- Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST);
- super.onMeasure(widthMeasureSpec, heightMeasureSpec_custom);
- ViewGroup.LayoutParams params = getLayoutParams();
- params.height = getMeasuredHeight();
- }
- }
- <com.example.extraclasses.NonScrollExpandableListView
- android:layout_width="match_parent"
- android:layout_height="wrap_content" />
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement