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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T16:24:46+00:00 2026-05-20T16:24:46+00:00

I’ve spent 3 hours trying to get this to work without success so heopfully

  • 0

I’ve spent 3 hours trying to get this to work without success so heopfully someone here can help.

I have a FrameLayout that is being loaded via inflate from an XML file and in it I have the following layout:

    <LinearLayout 
        android:layout_width="0dip"
        android:layout_height="fill_parent"
        android:layout_weight="1"
        android:orientation="vertical" >
        <ImageView 
        android:id="@+id/element_image"
            android:layout_width="wrap_content"
            android:layout_height="0dip" 
            android:layout_weight="1"
            android:layout_marginBottom="10dip"
            android:layout_marginLeft="10dip"
            android:scaleType="fitStart"
            android:background="#888888" >      
        </ImageView>
        <Button android:id="@+id/element_button"
            style="@style/Button"
            android:layout_gravity="right"
            android:text="@string/element_button_label"
        />  
    </LinearLayout> 

I have an image loaded from a BLOB which I want to display in this ImageView. In the GalleryAdaptor I load the image like this:

    ImageView image = (ImageView) v.findViewById(R.id.element_image);
    byte [] bitmapData = cursor.getBlob(4);
Bitmap bitmap = BitmapFactory.decodeByteArray(bitmapData, 0, bitmapData.length);            
    image.setImageBitmap(bitmap);   

When I use android:scaleType=”fitStart” in the layout above the image is not scaled to the height or width of the ImageView but is about a third of it’s width (which I can see from the grey background I have given it) and is centered.

If I use android:scaleType=”fitXY” the image height is scaled but the width is not. Again the image is centered.

Can someone give me some pointers on:

  1. How to get the image to scale both height and width wise
  2. How to align the image top right
  • 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-20T16:24:47+00:00Added an answer on May 20, 2026 at 4:24 pm

    Answering my own question here – but looks like this was just an issue with the source image resolution. Android (2.2 at least) does not seem to want to scale these images up when fitStart or fitEnd is used – but when fitXY is used it does scale them.

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

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
Does anyone know how can I replace this 2 symbol below from the string
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I am trying to loop through a bunch of documents I have to put
I have some data like this: 1 2 3 4 5 9 2 6

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.