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

  • Home
  • SEARCH
  • 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 9108463
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T02:48:53+00:00 2026-06-17T02:48:53+00:00

I am using the following xml to generate a row in a list view.

  • 0

I am using the following xml to generate a row in a list view. Though i have set the gravity as center_Vertical and right. Only center_Vertical is applied but not the “right” gravity. I have even tried inside the code. the “right” gravity is not working. Kindly help me to correct the code.
Thanks in Advance
enter image description here

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content" >

    <TextView
        android:id="@+id/tvTicketID"
        android:layout_width="wrap_content"
        android:layout_height="52dp"
        android:layout_centerVertical="true"  
        android:layout_alignParentLeft="true"  
        android:gravity="center_vertical|left"  
        android:text="Ticket ID"
        android:textSize="15dp" />

    <TextView
        android:id="@+id/tvCreationHour" 
        android:gravity="center_vertical|right" 
        android:layout_width="wrap_content"
        android:layout_height="52dp"
        android:layout_alignParentTop="true" 
        android:layout_marginLeft="40dp"
        android:layout_toRightOf="@+id/tvTicketID" 
        android:text="Hour" />

    <TextView
        android:id="@+id/tvTableNumber"
        android:gravity="center_vertical|right" 
        android:layout_width="wrap_content"
        android:layout_height="52dp"
        android:layout_alignParentTop="true" 
        android:layout_marginLeft="24dp"
        android:layout_toRightOf="@+id/tvCreationHour" 
        android:text="Table #" />

    <TextView
        android:id="@+id/tvAmount"
        android:gravity="center_vertical|right" 
        android:layout_width="wrap_content"
        android:layout_height="52dp"
        android:layout_alignParentTop="true"   
        android:layout_marginLeft="18dp"
        android:layout_toRightOf="@+id/tvTableNumber" 
        android:text="Amount" />

</RelativeLayout>

The code I use to create a row using the above xml

holder.tvTicketID.setText(String.valueOf(ticket.getId())) ;   
holder.tvCreationHour.setText(String.valueOf(ticket.getCreationHour())) ; 
holder.tvTableNumber.setText(String.valueOf(ticket.getTableNumber())) ;  
holder.tvAmount.setText(String.valueOf(ticket.getTotalAmount()))  ;  
  • 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-06-17T02:48:54+00:00Added an answer on June 17, 2026 at 2:48 am

    Finally, I fonund the answer. I have changed the android:layout_width=”wrap_content” in the TEXTVIEW to android:layout_width=”30dp”. Now it works..

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

Sidebar

Related Questions

I have to generate the following xml in my program using JAXB. <?xml version=1.0
friends, i have created custom title bar using following titlebar.xml file with code <?xml
I wanted to generate the following using XmlSerializer : <atom:link href=http://dallas.example.com/rss.xml rel=self type=application/rss+xml />
I am using the following code to generate and parse the XML. The method
I was using the following in web.xml to configure a servlet to dynamically generate
For example,I want to generate the following xml file by using java with DOM
In order to generate a XML i am using following Code currently. .<?php require
I am using MSXML 4 to generate the following xml string: <?xml version=1.0> <Parent_Element
I have the following input <row test=1 /> and want to generate the following
I have the following XML from which I am trying to generate HTML files.

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.