我如何像在图片上一样创建ui

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

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

在我的xml文件下面,但它没有给出我想要的输出

<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView 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="25dp"
    xmlns:android="http://schemas.android.com/apk/res/android">



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

        <TextView
            android:id="@+id/articleTitle"
            android:layout_width="match_parent"
            android:layout_height="30dp"
            android:paddingStart="60dp"
            android:paddingLeft="100dp" />
<TextView
            android:id="@+id/articleTitle"
            android:layout_width="match_parent"
            android:layout_height="30dp"
            android:paddingStart="60dp"
            android:paddingLeft="100dp" />


</androidx.cardview.widget.CardView>

rounded corner

android textview imageview cardview
2个回答
0
投票

在您的代码中尝试这个


0
投票

如果您是指项目行,也许您可​​以这样做

© www.soinside.com 2019 - 2024. All rights reserved.