【发布时间】:2021-04-30 23:22:51
【问题描述】:
我已经使用相对布局在 android 中为我的卡片视图创建了自定义按钮,并通过 这是我的代码: 包括布局代码:<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout
android:layout_width="125dp"
android:layout_height="30dp"
android:background="@color/colorPrimary"
android:layout_gravity="center_horizontal"
android:focusableInTouchMode="true">
<TextView
android:layout_width="125dp"
android:layout_height="30dp"
android:fontFamily="@font/questa"
android:text="Know More"
android:gravity="center"
android:textAllCaps="false"
android:textColor="#ffffff">
</TextView>
</FrameLayout>
</RelativeLayout>
<include
android:id="@+id/btnViewDetails"
style="@style/CardView.Button"
layout="@layout/button"
android:layout_width="125dp"
android:layout_height="30dp"
android:layout_below="@+id/viewDivider"
/>
【问题讨论】:
-
这能回答你的问题吗? How to create ripple effect in simple layout
标签: java android xml android-layout