Make customView scrollable when drew line became more than View size
I am using a custom View and plotting line of double size of Custom View
Following is my Custom View in xml
<HorizontalScrollView
android:layout_width="780dp"
android:layout_height="300dp"
android:layout_x="20dp"
android:layout_y="180dp">
<com.cdl.mircam.ScrollLineView
android:id="@+id/RectroGraphView"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
>
</com.cdl.mircam.ScrollLineView>
And this is my ScrollLineView view class code. As you can see my line is
more than double size of custom view. but when I am running it is not even
plotting any line.
I want whenever my line goes out of size, custom view has to be scrollable.
public ScrollLineView(Context context, AttributeSet attrs)
{
super(context, attrs);
pTestPaint.setColor(Color.RED);
setHorizontalScrollBarEnabled(true);
setWillNotDraw(false);
}
@Override
protected void onDraw(Canvas StoredPlotCanvas)
{
super.onDraw(StoredPlotCanvas);
StoredPlotCanvas.drawLine(0, 150, 2500, 150, pTestPaint);
StoredPlotCanvas.drawLine(0, 200, 1000, 200, pTestPaint);
}
Any help?
No comments:
Post a Comment