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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T10:47:13+00:00 2026-05-30T10:47:13+00:00

I have added a DatePicker to a TableRow inside a TableLayout . I am

  • 0

I have added a DatePicker to a TableRow inside a TableLayout. I am trying to perform right alignment of the DatePicker (see the code below). However, when I run the application the date picker is not aligned to the right.

<TableLayout
    android:id="@+id/_layout"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content" >

    <TableRow
        android:id="@+id/_row"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:gravity="right"
        android:layout_weight="1" >

        <DatePicker
            android:id="@+id/_date"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="right"
            android:layout_marginLeft="5dip"
            android:layout_marginRight="5dip"
            android:layout_weight="1" />
        </TableRow>
</TableLayout>

How can I align the date picker to the right?

  • 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-30T10:47:14+00:00Added an answer on May 30, 2026 at 10:47 am

    You have to do something like this:

    <TableRow
        android:id="@+id/_row"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:gravity="right" >
    
        <DatePicker
            android:id="@+id/_date"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="right"
            android:layout_marginLeft="5dip"
            android:layout_marginRight="5dip" />
        </TableRow>
    

    I’ve changed only the width of the date picker to wrap_content, the date picker is to the right but because is stretched to fill the parent, you can’t see that..

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

Sidebar

Related Questions

I have the code below in which I've added 1 alert at the start
I have added the following code to my app: NSDate * selected = [DatePicker
I have added some code which compiles cleanly and have just received this Windows
I have added multi-language using the short article below. When you add for example
strange bug: i have an ajax datepicker added to a text box of my
I have added above code in my WPF from which include animated GIF image,
I have added the JQuery Datepicker control to one of my ASP.Net pages. The
I have used this datepicker for quite awhile in this specific code. I made
EDIT: Added the NSRunLoop from my code, as mentioned by Deepak below. This was
I have the function below which takes a string from the datepicker and turns

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.