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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T11:51:30+00:00 2026-06-10T11:51:30+00:00

I recently tried to position an imageview’s x and y coordinates with no luck,

  • 0

I recently tried to position an imageview’s x and y coordinates with no luck, it seems there is no way to do it in Gingerbread. I then decided to try out paddings and margins, but when I set them, it shrinks my imageview. I set a left padding of 250dp and image view became tiny. The layout_height and width are set to wrap_content. I’m not sure what’s going on. Does anyone know why setting a padding/margin would shrink an imageview?

  • 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-10T11:51:31+00:00Added an answer on June 10, 2026 at 11:51 am

    You’re confusing margin and padding. Margin is the area outside of your view, while padding affects the content inside your margin.

    Margins and Padding Example

    If you set padding, then it is going to affect your available content area, and assuming you have a ScaleType set, it’s going to shrink your image down to fit the available space.

    Now, you say you’ve tried margins, but margins will do exactly what you’re asking.

    For example, if you wanted an ImageView placed 10dp from the top-left corner, you can do something like this:

    <?xml version="1.0" encoding="utf-8"?>
    <RelativeLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        >
        <ImageView
            android:id="@+id/my_image_view"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentTop="true"
            android:layout_alignParentLeft="true"
            android:layout_marginTop="10dp"
            android:layout_marginLeft="10dp"
            android:src="@drawable/my_image_id"
            />
    </RelativeLayout>
    

    Keep in mind that this places it 10dp with respect to the parent boundaries. If your parent layout also has padding, then that will affect your content placement.

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

Sidebar

Related Questions

I recently tried to figure out how to use freeglut with NetBeans 7. I
I recently tried to pull some results and was struggling to work out the
I recently tried to work out how the solution to a ThreadPool class works
As a learning experience I recently tried implementing Quicksort with 3 way partitioning in
I recently tried out a Free-To-Play MMORPG game called AIKA While trying the game
I recently tried out Microsoft's TFS-in-the-cloud service (TFSPreview.com) and felt the TFS team finally
I recently tried out the Compass inside Androids 4.0 API-Demos. It works as long
I recently tried to install kayako fusion helpdesk (ioncube) and found out a strange
I recently tried to combine SEAM and GWT in a project - but failed
I recently tried using the Cloud9 online IDE . It starts by creating a

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.