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

The Archive Base Latest Questions

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

Scope Image bitmap have to be shown as imageView.setImageBitmap(bitmap) and scaled to fit UI.

  • 0

Scope

Image bitmap have to be shown as imageView.setImageBitmap(bitmap) and scaled to fit UI. This could be done via:

  1. bitmap = Bitmap.createScaledBitmap(bitmap, newWidth, newHeight, true);
  2. xml’s ImageView attributes such as

    android:layout_width="newWidth"
    android:layout_height="newHeight"
    android:adjustViewBounds="true"
    android:scaleType="fitCenter"
    

Problem

Which way is better for performance? I prefer xml ’cause this is UI specific problem and I prefer to use xmls for UI definition. Also we set width/height values in dp, it means we have the same UI for different screens. Thanks!

  • 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-26T21:47:25+00:00Added an answer on May 26, 2026 at 9:47 pm

    This post discusses a very similar question in great detail:

    Android – Declarative vs Programmatic UI

    I think the major takeaway is that if you look at the Android source, many of the views are pulled from a hash map based on their XML tag. If it is good enough for Google in the core API, shouldn’t it be good enough for us?

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

Sidebar

Related Questions

Here is the mysterious: I have a scope which looks like this (in Image.rb)
Here is the mysterious: I have a scope which looks like this (in Image.rb)
The scope of this is that we have three main projects. Some of the
I have an image copied to the clicpboard from the word using Comment.Scope.CopyAsPicture() How
For example, I have a named scope sfw_only in my Image model that returns
I have this method which gets called from a different class: -(void)artworkInfo:(NSNumber *)pos{ [image
I have this nested loop that goes 4 levels deep to find all the
I have an object I created in JavaScript. Let's say it looks like this:
I have this piece of code // TR Fading when deleted $('.delete').live('click', function() {
I think this is a scope problem. Since the event is triggered after I

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.