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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T20:33:26+00:00 2026-05-21T20:33:26+00:00

I have a custom ListItem row that has a TextView on the top and

  • 0

I have a custom ListItem row that has a TextView on the top and a TextView on the bottom. I would like to create a Button that is right aligned, and in centered vertically. How can I do this in XML?

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="?android:attr/listPreferredItemHeight"
    android:padding="6dip">

    <LinearLayout
        android:orientation="vertical"
        android:layout_width="0dip"
        android:layout_weight="1"
        android:layout_height="fill_parent">
        <TextView
            android:id="@+id/toptext"
            android:layout_width="fill_parent"
            android:layout_height="0dip"
            android:layout_weight="1"
            android:gravity="center_vertical"
       android:textSize="18sp" android:textColor="#FFFFFF"/>

        <TextView
            android:layout_width="fill_parent"
            android:layout_height="0dip"
            android:layout_weight="1" 
            android:id="@+id/bottomtext"
            android:singleLine="true"
            android:ellipsize="marquee"
        android:textSize="15sp" android:textColor="#FFFFFF"/>

</LinearLayout>
</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-21T20:33:26+00:00Added an answer on May 21, 2026 at 8:33 pm

    i was thinking he wanted something like this:

    <?xml version="1.0" encoding="utf-8"?>
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent" android:layout_height="?android:attr/listPreferredItemHeight"
        android:padding="6dip">
        <Button android:text="@+id/Button01" android:id="@+id/Button01"
            android:layout_width="wrap_content" android:layout_alignParentRight="true"
            android:layout_centerVertical="true" android:layout_height="wrap_content" />
    
        <LinearLayout android:orientation="vertical"
            android:layout_toLeftOf="@+id/Button01" android:layout_width="fill_parent"
            android:layout_height="fill_parent" android:id="@+id/TextLayout">
            <TextView android:id="@+id/toptext" android:layout_width="fill_parent"
                android:layout_height="0dip" android:layout_weight="1"
                android:gravity="center_vertical" android:textSize="18sp"
                android:textColor="#FFFFFF" android:background="#FFAABB" />
    
            <TextView android:layout_width="fill_parent"
                android:layout_height="0dip" android:layout_weight="1" android:id="@+id/bottomtext"
                android:singleLine="true" android:ellipsize="marquee"
                android:textSize="15sp" android:textColor="#FFFFFF"
                android:background="#FFBBAACC" />
        </LinearLayout>
    </RelativeLayout>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a generic list of custom objects and would like to reduce that
I have a custom listview row that contains a number of textView components. Instead
I have custom event that has several different subscribers who will all use the
i have a listView with a custom BaseAdapter.Every list item has a clickable button.
I have a custom listview which display an image, textview and radio button. I
I have created a custom listview that is populated using a row.xml file. Each
I have a view that has a custom ArrayAdapter as a ListAdapter. Customer is
I have custom classes that I currently instantiate within App.xaml as resources. I want
I have custom gallery. Gallery represents items that are frame layout. There are one
I have custom component that I can place in my layout file (XML) for

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.