美文网首页
Android开发CardView加阴影

Android开发CardView加阴影

作者: 你的益达233 | 来源:发表于2024-02-29 11:27 被阅读0次

废话不多说,直接上代码

<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="58dp"
app:cardBackgroundColor="@color/white"
app:cardCornerRadius="4dp"
app:cardElevation="4dp"
app:cardPreventCornerOverlap="true"

另加些小知识,获取资源颜色:

titleView.setTextColor(ContextCompat.getColor(mContext, R.color.white));

相关文章

网友评论

      本文标题:Android开发CardView加阴影

      本文链接:https://www.haomeiwen.com/subject/vdhqzdtx.html