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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:14:20+00:00 2026-05-22T15:14:20+00:00

I am building a Twitter type client. Here is what my ListView row looks

  • 0

I am building a Twitter type client. Here is what my ListView row looks likeenter image description here

I want it to look more like:

enter image description here

How can I get my padding and positioning of the avatar correct? Here is my XML:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout android:id="@+id/RelativeLayout01" xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content">

     <ImageView 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:layout_alignParentTop="true"
        android:layout_alignParentLeft="true"
        android:id="@+id/avatarImageView">
     </ImageView>
    <TextView 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:id="@+id/usernameTextView" 
        android:textStyle="bold"
        android:layout_toRightOf="@+id/avatarImageView"
        android:layout_alignParentTop="true" android:textColor="#636363">
    </TextView>

    <TextView 
        android:id="@+id/bodyTextView" 
        android:layout_below="@+id/usernameTextView" 
        android:layout_toRightOf="@+id/avatarImageView"
        android:layout_width="fill_parent" 
        android:layout_height="wrap_content" android:textColor="#636363">
    </TextView>
    <TextView 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:layout_toRightOf="@+id/usernameTextView" 
        android:id="@+id/dateTextView" 
        android:text="date" android:textColor="#636363">
    </TextView>
</RelativeLayout>
  • 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-22T15:14:21+00:00Added an answer on May 22, 2026 at 3:14 pm
    <ListView android:id="@android:id/list"
            android:layout_width="fill_parent" android:layout_height="fill_parent"
            android:layout_weight="1.0"
            android:textColor="#444444"
            android:divider="@drawable/list_divider"
            android:dividerHeight="1px"
            android:cacheColorHint="#00000000">
    </ListView>
    

    create your own divider gradient named “list_divider” which is an xml file that you throw in your drawable folder. you just specify the colors for the left, center and right side:

    list_divider.xml

       <?xml version="1.0" encoding="utf-8"?>
    <layer-list
        xmlns:android="http://schemas.android.com/apk/res/android">
        <item>
            <shape>
                <gradient
                    android:startColor="#999999"
                    android:centerColor="#555555"
                    android:endColor="#999999"
                    android:height="1px"
                    android:angle="0" />
            </shape>
        </item>
    </layer-list>
    

    layout for each row in the list. This is also done through a layout xml file that you specify later in your code.

    row.xml

        <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:orientation="horizontal"
            android:padding="4px">
            <ImageView android:id="@+id/avatar"
                android:layout_width="48px"
                android:layout_height="48px"/>
            <LinearLayout
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical"
                android:paddingLeft="4px">
                <LinearLayout
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:orientation="vertical"
                    android:layout_weight="1"
                    android:gravity="center_vertical">
                    <TextView android:id="@+id/name"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:gravity="left"
                        android:textStyle="bold"
                        android:singleLine="true"
                        android:ellipsize="end"
                        android:textColor="#444444"
                        android:padding="0px"/>
                    <TextView android:id="@+id/email_url"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:gravity="left"
                        android:singleLine="true"
                        android:ellipsize="end"
                        android:padding="0px"
                        android:textSize="10px"/>
                    <TextView android:id="@+id/postTitle"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:gravity="left"
                        android:singleLine="true"
                        android:ellipsize="end"
                        android:padding="0px"
                        android:textSize="10px"/>
                    <TextView android:id="@+id/comment"
                        android:orientation="vertical"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:singleLine="false"
                        android:textColor="#666666"
                        android:maxLines="5"
                        android:ellipsize="end"/>
                <TextView android:id="@+id/status"
                        android:orientation="vertical"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:singleLine="true"/>
                </LinearLayout>
            </LinearLayout>
        </LinearLayout>
    

    edit: removed line number, because i m a kind person

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

Sidebar

Related Questions

I am building a twitter-like client. Assume I have a string: $AAPL rocks! I
I'm building a small twitter style microblogging service where users can follow other users
I am building a teensy tiny little Twitter client on the iPhone. Naturally, I'm
The site I'm building allows users to create posts and has a Twitter-like concept
I am building a twitter application where a user can enter a tweet and
As a proof of concept, I'm building this extremely simple Twitter Friends crawler. Here's
I'd building an app that uses hashtags, like Twitter or Tweetbot. When you're typing
I'm building an app (not necessarily a twitter client) and I'm trying to figure
I am building a web app from where the user can manage his twitter
I am building a Twitter client for android using Oauth1.0 and i am stuck

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.