Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6593113
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T17:38:26+00:00 2026-05-25T17:38:26+00:00

hello i have released my iphone app Micro-Pitch and am now porting it to

  • 0

hello i have released my iphone app Micro-Pitch and am now porting it to android. I cannot figure out how to draw lines in a scroll view and am wondering what i am doing wrong.

here is the part of my interface with the scroll view

<HorizontalScrollView android:id="@+id/scroll_view" android:layout_above="@+id/btn_info" android:layout_alignParentTop="true" android:layout_height="match_parent" android:layout_width="match_parent" android:overScrollMode="always" android:layout_alignParentRight="true" android:layout_alignParentLeft="true">
            <LinearLayout android:layout_height="match_parent" android:id="@+id/scroll_layout" android:layout_width="match_parent">
            </LinearLayout>
        </HorizontalScrollView>

this is my plot_view class

public class PlotView extends View
{
    Paint paint = new Paint();

    public PlotView(Context context)
    {
        super(context);
        paint.setColor(Color.RED);
    }

    @Override
    public void onDraw(Canvas canvas) {
            canvas.drawLine(0, 0, 200, 200, paint);
            canvas.drawLine(20, 0, 0, 20, paint);
    }
}

and this is the segment of my main activity class

HorizontalScrollView scroll_view;
LinearLayout scroll_layout;
PlotView plot_view;

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    scroll_view= (HorizontalScrollView)findViewById(R.id.scroll_view);
    scroll_layout= (LinearLayout)findViewById(R.id.scroll_layout);

    plot_view = new PlotView(this);
    plot_view.setBackgroundColor(Color.WHITE);
    scroll_layout.addView(plot_view);
}

The plotview is not even showing up on the scroll view

If possible please take a look a my iphone version of the app its free. What im doing this for is plotting the sound on the scroll view. that way you can get a better sense of what i am trying to do.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T17:38:27+00:00Added an answer on May 25, 2026 at 5:38 pm

    Your PlotView has zero size, you need to implement onMeasure(int, int) to determine the size it should need for drawing as explained here.

    You might also need to set some LinearLayout.LayoutParams for it since you’re adding the view to the LinearLayout through code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello I have been having trouble with this for a while now. I have
Hi have a problem with singleton Class in iPhone app. I have create a
My iPhone app is quite simple, however it errors out. My app delegate opens
Hello I would like to have my app pick a randome XIB file to
I have written a clean app (Hello, World) which builds correctly using Debug|Simulator and
Hello I am newish to android dev, I am using Eclipse and I have
Hello can someone help me with this pice of code. I have app with
I've upgraded the iOS SDK to the newly released 4.1 and now I have
Hello I have a table on which I have denied SELECT privs to a
Hello I have the following code namespace ConsoleApplication2 { class Program { static void

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.