Последний дочерний элемент RelativeLayout не отображается поверх другого дочернего элемента - PullRequest
0 голосов
/ 08 сентября 2018

Это то, чего я пытаюсь достичь.

enter image description here

Фактический результат:

enter image description here

Мой XML такой, какниже:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    >
    <Button
        android:id="@+id/question_button"
        android:layout_width="50dp"
        android:layout_height="50dp"
        android:layout_centerInParent="true"
        android:textColor="@android:color/black"
        android:background="@drawable/oval_button"
        android:textSize="16sp"
        android:gravity="center"
        android:layout_marginTop="10dp"/>
    <TextView
        android:layout_width="20dp"
        android:layout_height="20dp"
        android:text="X"
        android:gravity="center"
        android:textColor="@android:color/white"
        android:background="@drawable/oval_grid_wrong"
        android:layout_alignParentRight="true"/>
</RelativeLayout>

Как вывести X TextView на передний план?

1 Ответ

0 голосов
/ 08 сентября 2018

попробуйте удалить высоту кнопки по умолчанию в вашем xml

<Button
...
android:stateListAnimator="@null" 
....
/> 
...