Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class ScrollableWebView extends WebView {
- public ScrollableWebView(Context context) {
- super(context);
- }
- public ScrollableWebView(Context context, AttributeSet attrs) {
- super(context, attrs);
- }
- @Override
- protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
- int expandSpec = MeasureSpec.makeMeasureSpec(MEASURED_SIZE_MASK, MeasureSpec.AT_MOST);
- super.onMeasure(widthMeasureSpec, expandSpec);
- ViewGroup.LayoutParams params = getLayoutParams();
- params.height = getMeasuredHeight();
- setLayoutParams(params);
- }
- }
Add Comment
Please, Sign In to add comment