Относительный макет

Курс "Программирование под Андроид"
2 уровень , 6 лекция
Открыта
Комментарии (31)
ЧТОБЫ ПОСМОТРЕТЬ ВСЕ КОММЕНТАРИИ ИЛИ ОСТАВИТЬ КОММЕНТАРИЙ,
ПЕРЕЙДИТЕ В ПОЛНУЮ ВЕРСИЮ
Dmytrii Уровень 68
17 сентября 2024
заканчивался 24 год... а android:layout_centerVertical так и не поддерживается))
Александр Уровень 12
11 января 2022
+
Андрей Уровень 37
20 декабря 2021
отлично!
Ренат Уровень 16
15 августа 2021
если указать вот так: android:layout_alignParentRight="true" android:layout_alignParentLeft="true" то выравнивает по левому краю, а если так: android:layout_alignParentLeft="true" android:layout_alignParentRight="true" то выравнивает по левому краю. Вопрос: Почему?
Владислав Уровень 1
18 августа 2021
Я так полагаю, у Вас имеется параметр wrap_content, но контента на весь экран не хватает) А эти два параметра не взаимоисключающие. Тут как и в книге - если что-то пишется/добавляется, то с лева на право. Без особой необходимости контент растягиваться не будет.
Alex Snt. Уровень 1
7 июня 2021
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true" android:layout_alignParentTop="true" android:textAppearance="?android:textAppearanceLarge" android:text="Happy" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_alignParentLeft="true" android:textAppearance="?android:textAppearanceLarge" android:text="Birthday" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:textAppearance="?android:textAppearanceLarge" android:layout_alignParentBottom="true" android:layout_alignParentRight="true" android:text="To You" /> </RelativeLayout>
kellgk Уровень 2
27 апреля 2021
centerVertical не работает
1 апреля 2021
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentTop="true" android:textAppearance="?android:textAppearanceLarge" android:text="Happy" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentTop="true" android:layout_centerHorizontal="true" android:textAppearance="?android:textAppearanceLarge" android:text="Birthday" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentTop="true" android:layout_alignParentRight="true" android:textAppearance="?android:textAppearanceLarge" android:text="To You" /> </RelativeLayout>
Руслан Асаев Уровень 14
19 января 2021
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true" android:layout_alignParentBottom="true" android:textAppearance="?android:textAppearanceLarge" android:text="Happy" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_alignParentLeft="true" android:textAppearance="?android:textAppearanceLarge" android:text="Birthday" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:textAppearance="?android:textAppearanceLarge" android:text="To You" /> </RelativeLayout>
🦔 Виктор Уровень 20 Expert
24 ноября 2020
Задания нет. Вертикальное центрирование всё ещё не поддерживается в визуализаторе:

Line 11: The attribute `android:layout_centerVertical` is not supported here.
DoZ Уровень 1
29 октября 2020

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

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentTop="true"
        android:textAppearance="?android:textAppearanceLarge"
        android:text="Happy" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        android:layout_alignParentRight="true"
        android:textAppearance="?android:textAppearanceLarge"
        android:text="Birthday" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentBottom="true"
        android:layout_centerHorizontal="true"
        android:textAppearance="?android:textAppearanceLarge"
        android:text="To You" />

</RelativeLayout>
Не работает android:layout_centerVertical="true"