我如何创建与图片相同的ui

问题描述 投票:3回答:2

我正在开发android应用,如何创建如下图所示的ui

并且在我的xml下面,我一直玩耍,但是它没有提供预期的输出,任何建议将不胜感激,并且欢迎欢迎提示,我不知道我到底在哪里犯错误

<?xml version="1.0" encoding="utf-8"?>

<androidx.cardview.widget.CardView xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    xmlns:card_view="http://schemas.android.com/apk/res-auto"
    card_view:cardPreventCornerOverlap="false"
    card_view:cardCornerRadius="50dp"
    xmlns:android="http://schemas.android.com/apk/res/android">

<androidx.constraintlayout.widget.ConstraintLayout

     android:layout_width="wrap_content"
     android:layout_height="wrap_content">


        <TextView
            android:id="@+id/articleTitle"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_below="@id/articleSource"
            android:paddingBottom="45dp"
            android:text="22222222"
            tools:layout_editor_absoluteX="25dp"
            tools:layout_editor_absoluteY="16dp" />


    <ImageView
        android:layout_width="60dp"
        android:contentDescription="@string/bbc_sport"
        android:layout_height="60dp"/>

    <TextView
        android:id="@+id/articleSource"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:paddingLeft="90dp"
        android:text="News blalalalal"/>




    <TextView
        android:id="@+id/articleTime"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:paddingLeft="90dp"
        android:text="News blalalalal"/>
</androidx.constraintlayout.widget.ConstraintLayout
        >

</androidx.cardview.widget.CardView>

enter image description here

android cardview
2个回答
0
投票

0
投票
© www.soinside.com 2019 - 2024. All rights reserved.