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

  • SEARCH
  • Home
  • 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 8018759
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T21:12:18+00:00 2026-06-04T21:12:18+00:00

Layouting in Android is getting me rather perplexed. I’m slowly implementing a custom ImageView

  • 0

Layouting in Android is getting me rather perplexed.
I’m slowly implementing a custom ImageView where I’d like to make use of the ZoomButtonsController.
However, I would like to decide where the zoom buttons go in the layout and I can’t figure out how to move them from the default bottom center position.

I have been experimenting with layouting simple views such as buttons in the main activity and this seems to be working as I would guess and expect.
In the case of the ZoomButtonsController I would however like to reposition them. I’m using a RelativeLayout as the mail layout and add the ZoomButtonsController within the custom ImageView.

The Activity code

public class ImageViewActivity extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        CustomImageView imageView = new CustomImageView(this);
        relativeLayout.addView(imageView);
    }
}

The CustomImageView code

public class CustomImageView extends ImageView {
    private ZoomButtonsController mZoomButtons;

    public CustomImageView(Context context) {
        super(context);
        RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.FILL_PARENT, RelativeLayout.LayoutParams.FILL_PARENT);
        mZoomButtons = new ZoomButtonsController(this);
        mZoomButtons.getZoomControls();
        layoutParams.addRule(RelativeLayout.ALIGN_PARENT_TOP);
        layoutParams.addRule(RelativeLayout.CENTER_HORIZONTAL);
        setLayoutParams(layoutParams);
    }

    @Override
    public boolean onTouchEvent(MotionEvent ev) {
        Log.d("TAG", "touch");
        mZoomButtons.setVisible(true);
        return true;
    }
}

I’ve tested with WRAP_CONTENT in the parameters, but this only makes the zoom buttons disappear.

  • 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-04T21:12:19+00:00Added an answer on June 4, 2026 at 9:12 pm

    As a matter of fact, I couldn’t position the ZoomButtonsController in any way and in the end had to accept the default placement.

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

Sidebar

Related Questions

I've stumbled upon this great website layout, and would like to use a layouting
I have a layouting problem with my android application: I have a Listview consiting
I am usually using table to do layouting. But I would like to try
I would like to create a custom XUL element named 'video' for a video
I would like use unmanaged code from C in C#. I built a DLL
I am doing manual layouting for my Cocoa application and at some point I
I'm currently porting my jruby/java2d Graph Drawing/Layouting application to macruby/cocoa. Therefore I need to
I have a struct that looks something like this: [StructLayout(LayoutKind.Sequential)] public struct in_addr {
I would like to do the following: [StructLayout(LayoutKind.Sequential, Pack = 1)] public struct SomeStruct
I'd like to know how to draw two PNG pictures onto the screen. My

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.