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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:12:48+00:00 2026-05-26T19:12:48+00:00

I want to create a layout like below.. This is the XML i have

  • 0

I want to create a layout like below..

enter image description here

This is the XML i have come across

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="vertical" >

        <ImageView
            android:id="@+id/display_photo"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:src="@drawable/ic_launcher" />
    </LinearLayout>

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="vertical" >

        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="horizontal" >

            <TextView
                android:id="@+id/username"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:ellipsize="end"
                android:singleLine="true"
                android:text="Username"
                android:textColor="#000000" />

            <TextView
                android:id="@+id/timestamp"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_weight="0"
                android:singleLine="true"
                android:text="2 hours ago"
                android:textColor="#000000" />
        </LinearLayout>

        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="horizontal" >

            <TextView
                android:id="@+id/location"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:singleLine="true"
                android:text="Location"
                android:textColor="#000000" />
        </LinearLayout>
    </LinearLayout>
</LinearLayout>

How can i have the text over with …. after certain characters.. and how to place the time on the right handside ?

  • 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-26T19:12:48+00:00Added an answer on May 26, 2026 at 7:12 pm

    To achieve that kind of Layout you better use Relative Layout which will be rendered properly amongst any devices.Something like this should be okay.

    <?xml version="1.0" encoding="utf-8"?>
    <RelativeLayout android:id="@+id/relativeLayout1"
    android:layout_width="fill_parent" android:gravity="center"
    android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android"
    android:background="#FFFFFF">   
    <ImageView android:layout_height="100px" android:id="@+id/deal_image"
        android:layout_width="120px" android:layout_alignParentTop="true"
        android:layout_alignParentLeft="true"></ImageView>
    <TextView android:id="@+id/deal_description"
        android:layout_width="fill_parent" android:layout_height="wrap_content"
        android:layout_toRightOf="@+id/deal_image" android:layout_marginLeft="5dip"
        android:padding="2dp" android:textColor="#000000" />
    <TextView android:id="@+id/deal_time" android:layout_height="wrap_content"
        android:layout_width="120px" android:padding="2dp"
        android:layout_below="@+id/deal_image" android:textColor="#FFFFFF"
        android:background="#13ADDF" android:textSize="12dip"></TextView>
    
    <TextView android:id="@+id/real_price" android:layout_height="wrap_content"
        android:layout_width="120px" android:padding="2dp"
        android:layout_below="@id/deal_time" android:textColor="#FFFFFF"
        android:background="#13ADDF" android:textSize="12dip"></TextView>
    <TextView android:id="@+id/deal_price" android:layout_height="wrap_content"
        android:layout_width="fill_parent" android:padding="2dp"
        android:background="#FFFFFF" android:layout_toRightOf="@id/real_price"
        android:layout_toLeftOf="@id/buy_button" android:textStyle="bold"
        android:textColor="#13ADDF" android:textSize="15dip"
        android:layout_below="@id/deal_description" android:gravity="center"
        android:layout_alignParentBottom="true" android:layout_alignBottom="@id/buy_button"></TextView>
    
    
    </RelativeLayout>
    

    You can edit this and can achieve the structure that you want to display pretty much easily.

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

Sidebar

Related Questions

I want to create an android activity that looks like the one below this.
I have to create the Layout (in xml or in java) as like Below
I have one ImageButton in my xml layout like that : <ImageButton android:id=@+id/tabsButton android:background=@drawable/button
I have created a button in my screen's XML like this: <Button android:text=Lets Get
I want to create a layout like the below picture. How can I set
In My application i want to create the layout as like below image: So
I want to create separate folders for my layouts, like this in my resource
I want to create a Button otherthan creating it from xml layout.i want to
I want to create an Application with tabs, and I have found this guide
I want to create an element using DIV and CSS like below: Create By:

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.