Can't figure it out how to add text underneath two Relative Layouts

Viewed 27

Hi guys I was wondering can you help me with this, I want to add text under card views in the same Linear Layout. I will post an image with an example. I already have Linear Layout with two relative layouts and card views in it, all that I want to do is add text under those card views or relative layouts, but I can't find a solution. Do you think that you can help me?

Image of where I want my text to be:

enter image description here

Code:

            <androidx.cardview.widget.CardView
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:layout_margin="10dp"
                android:elevation="8dp"
                app:cardCornerRadius="10dp"
                android:layout_weight="1">

                <RelativeLayout
                    android:layout_width="match_parent"
                    android:layout_height="match_parent">

                    <TextView
                        android:id="@+id/znamenitostitekst"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_centerHorizontal="true"
                        android:layout_marginTop="103dp"
                        android:fontFamily="@font/aclonica"
                        android:autoSizeTextType="uniform"
                        android:autoSizeMinTextSize="10sp"
                        android:autoSizeMaxTextSize="17sp"
                        android:autoSizeStepGranularity="2sp"
                        android:text="@string/znemenitosti"
                        android:textSize="17sp" />

                    <ImageView
                        android:id="@+id/znamenitosti"
                        android:layout_width="120dp"
                        android:layout_height="120dp"
                        android:layout_centerHorizontal="true"
                        app:srcCompat="@mipmap/museum_icon_foreground" />

                    <Button
                        android:id="@+id/znamenitosti_button"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:background="#00000000"
                        android:text="null"
                        android:textColor="#00FFFFFF" />

                </RelativeLayout>
            </androidx.cardview.widget.CardView>

            <androidx.cardview.widget.CardView
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:layout_margin="10dp"
                android:elevation="8dp"
                app:cardCornerRadius="10dp"
                android:layout_weight="1">

                <RelativeLayout
                    android:layout_width="match_parent"
                    android:layout_height="match_parent">

                    <TextView
                        android:id="@+id/događajitekst"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_centerHorizontal="true"
                        android:layout_marginTop="103dp"
                        android:fontFamily="@font/aclonica"
                        android:autoSizeTextType="uniform"
                        android:autoSizeMinTextSize="10sp"
                        android:autoSizeMaxTextSize="17sp"
                        android:autoSizeStepGranularity="2sp"
                        android:text="@string/doga_aji"
                        android:textSize="17sp" />

                    <ImageView
                        android:id="@+id/Događaji"
                        android:layout_width="120dp"
                        android:layout_height="120dp"
                        android:layout_centerHorizontal="true"
                        app:srcCompat="@mipmap/eventsnew_icon_foreground" />

                    <Button
                        android:id="@+id/dogadjaji_button"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:background="#00000000"
                        android:text="null"
                        android:textColor="#00FFFFFF" />

                </RelativeLayout>
            </androidx.cardview.widget.CardView>

        </LinearLayout>
0 Answers
Related