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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T02:15:47+00:00 2026-05-18T02:15:47+00:00

This is my main.xml that I use, and the two images in the myImage_Main

  • 0

This is my main.xml that I use, and the two images in the myImage_Main and myImage_Main2 are messed up.
Is there a way to set the android:layout_width to the size of the bitmap? or do i just set it to 500px which is about the size of the screen?

Example what i want :

Scroll view -------------------------------
|
|               Image 1 Full Sized on Screen
|
|
|               Bottom of screen
___________________________________________
|              Not yet on screen, but  
|           Scroll down to see Image 2    |
|
|
|
|_____________________________________________|
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >


     <LinearLayout
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:orientation="horizontal"
          android:layout_gravity="top"
        >
        <Button android:id="@+id/myButton_Search"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/btn_search"
    android:layout_gravity="top"
    />
    <Button android:id="@+id/myButton_Save"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/btn_save"
    android:layout_gravity="top"
    />
    </LinearLayout>

     <EditText
     android:id="@+id/myEdittext"
     android:layout_width="fill_parent"
     android:layout_height="wrap_content"
     android:layout_gravity="bottom"
     />
 <ScrollView android:id="@+id/ScrollView01"
 android:layout_width= **Right here I want to get the size of the image i use as the width**
 android:layout_height=**Right here I want to get the size of the image i use as the height**
 android:fillViewport="true"
 android:scrollY="100px"
 >
 <LinearLayout android:id="@+id/LinearLayout02"
 android:layout_width=**Right here I want to get the size of the image i use as the width**
 android:layout_height=**Right here I want to get the size of the image i use as the height**
 android:orientation="vertical">
    <ImageView android:id="@+id/myImage_Main"
   android:layout_width="fill_parent"
   android:layout_height="fill_parent"
   android:scaleType="fitCenter"
   />
   <ImageView android:id="@+id/myImage_Main2"
   android:layout_width="fill_parent"
   android:layout_height="fill_parent"
   android:scaleType="fitCenter"
   />
   </LinearLayout>
   </ScrollView>
</LinearLayout>
  • 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-18T02:15:47+00:00Added an answer on May 18, 2026 at 2:15 am

    Just use wrap_content for all of those. When the layout is inflated in setContentView(R.layout.your_layout), it will determine the exact amount of width needed to display all of its child views. You’ll need to set scaleType="none", however. I’m not entirely sure what you’re trying to accomplish, so if I’m misunderstanding the question, please clarify.

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

Sidebar

Related Questions

I have a GridView like this( main.xml ): <?xml version=1.0 encoding=utf-8?> <GridView xmlns:android=http://schemas.android.com/apk/res/android android:id=@+id/gridView1
my android app crash before load main.xml. This is the exception thrown java.lang.RuntimeException: Unable
I'm working with a system that generates this type of XML: <address> <addressLine>123 Main
This code works well for displaying separate xml items in my main.xml. But is
My XML format is this : <Main> <IsD>false</IsD> <IsN>true</IsN> <ID>826e03b3-191c-40c9-8a3d-f6607842fa5f</ID> <ClientId>c6a32c38-0398-4806-b82f-e924f96217fa</ClientId> <General> <IsD>false</IsD> <IsN>true</IsN>
I have a system that runs like this: main.exe runs sub.exe runs sub2.exe and
Is it possible to define in XML schema that there must be some certain
I have a question about Android. Assume we have our main xml layout file,
I have two xml files in my application - main.xml and options.xml . In
I want to make use of the android xml layouts. I have put 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.