Put TextView on right bottom corner

Imrik

I need to put a textView on the right bottom corner of the layout and I don't know how to do it without absoluteX and absoluteY coords.

I put the code below and also a screen capture:

<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.prodintec.am_motion.QuizActivity">

<RelativeLayout
    android:layout_width="368dp"
    android:layout_height="wrap_content"
    tools:layout_editor_absoluteY="0dp"
    tools:layout_editor_absoluteX="8dp">

    <TableLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:paddingTop="20dp"
        android:paddingEnd="10dp"
        android:paddingStart="10dp">

        <TableRow
            android:padding="2dp"
            android:id="@+id/tableRow1"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" >

            <TextView
                android:id="@+id/HeaderTextView"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="FOUR OPTIONS QUESTION" />
        </TableRow>

        <TableRow
            android:padding="2dp"
            android:id="@+id/tableRow2"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" >

            <Button
                android:id="@+id/answer1"
                android:layout_width="0dip"
                android:layout_height="fill_parent"
                android:layout_weight="1"
                android:layout_gravity="center"
                android:paddingLeft="20dp"
                android:paddingRight="20dp"
                android:layout_marginLeft="2dp"
                android:layout_marginRight="2dp"
                android:layout_marginBottom="2dp"
                android:background="@color/primary"
                android:textColor="@color/accent"
                android:textSize="20dp"
                android:text="ANSWER 1" />

            <Button
                android:id="@+id/answer2"
                android:layout_width="0dip"
                android:layout_height="fill_parent"
                android:layout_weight="1"
                android:layout_gravity="center"
                android:paddingLeft="20dp"
                android:paddingRight="20dp"
                android:layout_marginLeft="2dp"
                android:layout_marginRight="2dp"
                android:layout_marginBottom="2dp"
                android:background="@color/primary"
                android:textColor="@color/accent"
                android:textSize="20dp"
                android:text="ANSWER 2" />
        </TableRow>

        <TableRow
            android:padding="2dp"
            android:id="@+id/tableRow3"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" >

            <Button
                android:id="@+id/answer3"
                android:layout_width="0dip"
                android:layout_height="fill_parent"
                android:layout_weight="1"
                android:layout_gravity="center"
                android:paddingLeft="20dp"
                android:paddingRight="20dp"
                android:layout_marginLeft="2dp"
                android:layout_marginRight="2dp"
                android:layout_marginBottom="2dp"
                android:background="@color/primary"
                android:textColor="@color/accent"
                android:textSize="20dp"
                android:text="ANSWER 3" />

            <Button
                android:id="@+id/answer4"
                android:layout_width="0dip"
                android:layout_height="fill_parent"
                android:layout_weight="1"
                android:layout_gravity="center"
                android:paddingLeft="20dp"
                android:paddingRight="20dp"
                android:layout_marginLeft="2dp"
                android:layout_marginRight="2dp"
                android:layout_marginBottom="2dp"
                android:background="@color/primary"
                android:textColor="@color/accent"
                android:textSize="20dp"
                android:text="ANSWER 4" />
        </TableRow>

        <TableRow
            android:padding="2dp"
            android:id="@+id/tableRow4"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" >

            <TextView
                android:id="@+id/HeaderTextView2"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="TWO OPTIONS QUESTION" />
        </TableRow>

        <TableRow
            android:padding="2dp"
            android:id="@+id/tableRow5"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" >

            <Button
                android:id="@+id/answer5"
                android:layout_width="0dip"
                android:layout_height="fill_parent"
                android:layout_weight="1"
                android:layout_gravity="center"
                android:paddingLeft="20dp"
                android:paddingRight="20dp"
                android:layout_marginLeft="2dp"
                android:layout_marginRight="2dp"
                android:layout_marginBottom="2dp"
                android:background="@color/primary"
                android:textColor="@color/accent"
                android:textSize="20dp"
                android:text="ANSWER 1" />

            <Button
                android:id="@+id/answer6"
                android:layout_width="0dip"
                android:layout_height="fill_parent"
                android:layout_weight="1"
                android:layout_gravity="center"
                android:paddingLeft="20dp"
                android:paddingRight="20dp"
                android:layout_marginLeft="2dp"
                android:layout_marginRight="2dp"
                android:layout_marginBottom="2dp"
                android:background="@color/primary"
                android:textColor="@color/accent"
                android:textSize="20dp"
                android:text="ANSWER 2" />
        </TableRow>
    </TableLayout>
    <TextView
        android:id="@+id/PointsTextView"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:text="POINTS:" />
</RelativeLayout>

</android.support.constraint.ConstraintLayout>

enter image description here

Can anyone help me? Thanks!

Sneha Sarkar

For Points TextView use the below code:

<TextView
    android:id="@+id/PointsTextView"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:padding="5dp"
    android:text="POINTS:"
    android:textAlignment="textEnd" />

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Java

how to set cornerRadius for only bottom-left,bottom-right and top-left corner textview?

From Dev

stick a image to the bottom right corner

From Dev

Move form to bottom right corner

From Dev

Extjs button on the bottom right corner

From Dev

How to put a window on the right bottom corner on every using the desktop resolution (Winforms)

From Dev

bottom-right corner of border is missing?

From Dev

ScrollViewer WPF bottom right corner color

From Dev

How to position to bottom right corner without overlapping

From Dev

Jquery animate from right bottom corner to

From Dev

How to add an icon to a button at the bottom right corner

From Dev

The postioning at the bottom right corner using jQuery

From Dev

Border Layout Positioning on bottom right (but not top) corner

From Dev

Outputting a string in the bottom right corner of the terminal

From Dev

bottom-right corner of border is missing?

From Dev

The postioning at the bottom right corner using jQuery

From Dev

Right bottom corner textbox in desktop; what's it for?

From Dev

Move buttons to the bottom right corner of the header

From Dev

UITableviewCell Bottom Left & Right corner radius

From Dev

half borders at top right corner and bottom left corner with css

From Dev

Button put text right corner with class

From Dev

How to display legend in bottom right corner instead of top right?

From Dev

How would i make imageView rolling in from bottom left corner to the bottom right corner?

From Dev

How to put an image at bottom of TextView row in a ListView

From Dev

Moving inner div to the bottom-right corner of the outer parent div

From Dev

curses fails when calling addch on the bottom right corner

From Dev

Quotes in top-left and bottom-right corner of div

From Dev

Moving an div from the top left corner to bottom right using css

From Dev

Position fixed element in bottom right corner of page with CSS3

From Dev

iOS - Facebook POP: slide tableview cell to bottom right corner

Related Related

  1. 1

    how to set cornerRadius for only bottom-left,bottom-right and top-left corner textview?

  2. 2

    stick a image to the bottom right corner

  3. 3

    Move form to bottom right corner

  4. 4

    Extjs button on the bottom right corner

  5. 5

    How to put a window on the right bottom corner on every using the desktop resolution (Winforms)

  6. 6

    bottom-right corner of border is missing?

  7. 7

    ScrollViewer WPF bottom right corner color

  8. 8

    How to position to bottom right corner without overlapping

  9. 9

    Jquery animate from right bottom corner to

  10. 10

    How to add an icon to a button at the bottom right corner

  11. 11

    The postioning at the bottom right corner using jQuery

  12. 12

    Border Layout Positioning on bottom right (but not top) corner

  13. 13

    Outputting a string in the bottom right corner of the terminal

  14. 14

    bottom-right corner of border is missing?

  15. 15

    The postioning at the bottom right corner using jQuery

  16. 16

    Right bottom corner textbox in desktop; what's it for?

  17. 17

    Move buttons to the bottom right corner of the header

  18. 18

    UITableviewCell Bottom Left & Right corner radius

  19. 19

    half borders at top right corner and bottom left corner with css

  20. 20

    Button put text right corner with class

  21. 21

    How to display legend in bottom right corner instead of top right?

  22. 22

    How would i make imageView rolling in from bottom left corner to the bottom right corner?

  23. 23

    How to put an image at bottom of TextView row in a ListView

  24. 24

    Moving inner div to the bottom-right corner of the outer parent div

  25. 25

    curses fails when calling addch on the bottom right corner

  26. 26

    Quotes in top-left and bottom-right corner of div

  27. 27

    Moving an div from the top left corner to bottom right using css

  28. 28

    Position fixed element in bottom right corner of page with CSS3

  29. 29

    iOS - Facebook POP: slide tableview cell to bottom right corner

HotTag

Archive