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 8322787
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T23:30:04+00:00 2026-06-08T23:30:04+00:00

I have a custom view that draws several different things on screen. Each one

  • 0

I have a custom view that draws several different things on screen. Each one has its own paint object. Everything is drawing fine EXCEPT the text. It works just fine in Gingerbread, but ICS+ has no text.

Here is my on draw method:

protected void onDraw(Canvas canvas)
{
   canvas.save(Canvas.MATRIX_SAVE_FLAG);
   canvas.scale(getWidth(), getHeight());

   drawGrid(canvas);
   drawHeader(canvas);
   drawSelected(canvas);
   drawDays(canvas);
   drawToday(canvas);

   canvas.restore();
}

Grid, Selected, and Today work fine. Header and Days are the text drawing and they don’t work.

Here is the drawHeader method:

private void drawHeader(Canvas canvas)
{
   canvas.drawText("Sun", DAYS[0], .05f, paintDaysOfTheWeek);
   canvas.drawText("Mon", DAYS[1], .05f, paintDaysOfTheWeek);
   canvas.drawText("Tues", DAYS[2], .05f, paintDaysOfTheWeek);
   canvas.drawText("Wed", DAYS[3], .05f, paintDaysOfTheWeek);
   canvas.drawText("Thurs", DAYS[4], .05f, paintDaysOfTheWeek);
   canvas.drawText("Fri", DAYS[5], .05f, paintDaysOfTheWeek);
   canvas.drawText("Sat", DAYS[6], .05f, paintDaysOfTheWeek);

   canvas.drawLine(.01f, .0f, .99f, .0f, paintMediumBlack);
   canvas.drawLine(.01f, .07f, .99f, .07f, paintMediumBlack);
}

Any ideas?

  • 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-06-08T23:30:05+00:00Added an answer on June 8, 2026 at 11:30 pm

    I fixed the issue by adding

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB)
        setLayerType(LAYER_TYPE_SOFTWARE, paint)
    

    to my custom view. Not sure why I needed it, and if anyone could explain it, that would be great.

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

Sidebar

Related Questions

I have a custom view that draws a scrollable bitmap to the screen. In
I have a custom control/view that observes the direction of a gesture within its
I have a custom view, that has page and block. But the problem when
Currently on a view I have a ImageView and A custom class that draws
I have a custom view that fills my entire screen. (A piano keyboard) When
I have a custom view that draws an CGImage using: - (void) drawImage {
I have a custom view subclass similar to NSBox that draws a rounded box
I have a custom view that accepts drags. In the custom view there is
I have a custom View that I would like to embed in an WebView.
I'm using Drupal 6. I have a custom view that needs to be filtered

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.