Open apatrone opened 8 years ago
when using a custom view inside a Scroll view, you have to override onMeasure method and set width and height for your custom view.. eg:
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
int widthMeasure = MeasureSpec.makeMeasureSpec(200, MeasureSpec.EXACTLY);
int heightMeasure = MeasureSpec.makeMeasureSpec(200, MeasureSpec.EXACTLY);
setMeasuredDimension(widthMeasure, heightMeasure);
}
I have an activity that shows a CircleDisplay beneath a chart. All works well when the layout is placed inside a LinearLayout. But when I place this LinearLayout inside a ScrollView, the CircleDisplay disappears (while the chart is still being shown correctly). Can this be a bug or am I missing something?