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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T03:56:00+00:00 2026-05-29T03:56:00+00:00

I have three text blocks and an image which I would like to to

  • 0

I have three text blocks and an image which I would like to to fit in a layout as indicated in the sketch. (Ignore the red lines for a second.)
enter image description here
(I know the quality is awful. If anyone can recommend me a decent (open) graphic editor for os x/linux I’d appreciate it! (nope, not gimp!))

My idea was to tackle the problem like this:

  • Relative Layout.
  • position the second text block relative to the first one.

e.g.:

android:layout_below=text1  
android:layout_ (make it "float" to screen's right edge - not sure how to do that, yet.
  • The third text block relative to the 1st and 2nd block.

e.g.:

android:layout_below=text2
android:layout_alignLeft = text1

Ok. No let’s get to the image. It’s arbitrary size so I thought with some aligns I could fit it in. If you know look at the red lines from the sketch I though about aligning the image accordingly.

android:layout_alignTop = text2
android:layout_alignBottom = text2
android:layout_alignLeft = text1

However I’m not very good in doing layouts and when I tried to implement it like this the 4 pieces of content more or less knocked around on the screen but I never got them all into position.

The closest I could achieve was this but I don’t like the usage of hard coded limits in there. I’m afraid it is not super flexible then.
though I have to limit the display size of the image somewhat I was hoping with the surrounded text blocks the droids would be smart enough to figure out the size by their own.

<TextView
    android:id="@+id/text1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginTop="10dip"
    android:text="text1" />

<ImageView
    android:id="image"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_below="text1"
    android:layout_marginRight="7dip"
    android:layout_marginTop="5dip"
    android:adjustViewBounds="true"
    android:maxHeight="150sp"
    android:maxWidth="150sp"
    android:src="srcFile" />

<TextView
    android:layout_marginTop="5dip"
    android:id="text2"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_alignTop="image"
    android:layout_below="text1"
    android:layout_toRightOf="image"
    android:text="text2" />

<TextView
    android:id="text3"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_below="image"
    android:layout_marginTop="10dip"
    android:text="text3" />

So I’d like to hear what you think about my approach and if there’s something I could improve as well as how to actually implement it.

edit:
So I’d like to find a solution where I could drop this part of the code because I’m afraid it’s not flexible enough:

android:maxHeight="150sp"
android:maxWidth="150sp"
  • 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-29T03:56:01+00:00Added an answer on May 29, 2026 at 3:56 am

    It is possible to keep the proportions of the image and adjust its size without code. Simply use linear layouts and weight the views accordingly

    <TextView
           android:id="@+id/text1"
           android:layout_width="wrap_content"
           android:layout_height="wrap_content"
           android:text="text1" />
    
       <LinearLayout
           android:id="@+id/ll"
           android:layout_below="@+id/text1"
           android:layout_width="fill_parent"
           android:layout_height="wrap_content"
           android:weightSum="2"
           android:orientation="horizontal" >
    
           <ImageView
               android:id="@+id/image"
               android:layout_width="wrap_content"
               android:layout_height="wrap_content"
               android:layout_weight="11"
               android:adjustViewBounds="true"
               android:src="srcFile" />
    
           <TextView
               android:id="@+id/text2"
               android:layout_weight="1"
               android:layout_width="wrap_content"
               android:layout_height="wrap_content"
               android:text="text2" />
       </LinearLayout>
    
       <TextView
           android:id="@+id/text3"
           android:layout_width="wrap_content"
           android:layout_height="wrap_content"
           android:layout_below="@+id/ll"
           android:text="text3" />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following three tables: alt text http://img16.imageshack.us/img16/5499/linqtosqlquery.jpg With LinqToSql I would like
I have three text boxes on the stage id=red, blue, green same as the
I have text file with something like first line line nr 2 line three
I have three column in my datagridview .One is text ,one is Combo and
I have an ASP.NET form with three text inputs, one each for Work Phone,
I have a UILabel with right-aligned text that may vary from between three to
I'm developing my first ever MODx site and I need to have three blocks
I have infinite number of divs of a 100px width, which can fit into
In the code below I have two Canvas layers one text and one image,
I have a header which I constructed like this: <header class=top> <a href=> <span

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.