亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如何從 MaterialCardVew 中移除漣漪效應?

如何從 MaterialCardVew 中移除漣漪效應?

慕碼人8056858 2022-04-28 16:55:58
如何禁用觸摸漣漪效應MaterialCardView?將clickable屬性設置為false或使用foreground和background屬性沒有效果。我正在使用材料支持庫版本1.1.0-alpha02。
查看完整描述

3 回答

?
蝴蝶不菲

TA貢獻1810條經驗 獲得超4個贊

只有rippleColor是styleable:


<com.google.android.material.card.MaterialCardView

    style="@style/Widget.MaterialComponents.CardView"

    app:rippleColor="@android:color/transparent"

    android:layout_width="match_parent"

    android:layout_height="wrap_content">


</com.google.android.material.card.MaterialCardView>


查看完整回答
反對 回復 2022-04-28
?
慕哥6287543

TA貢獻1831條經驗 獲得超10個贊

只需在 xml 中使用此屬性:
app:rippleColor="@android:color/transparent"

或者在 Kotlin 中以編程方式:
cardView.rippleColor = ColorStateList.valueOf(Color.TRANSPARENT)


查看完整回答
反對 回復 2022-04-28
?
慕妹3146593

TA貢獻1820條經驗 獲得超9個贊

您可以像這樣使用 CSS:


.mdc-card__primary-action.card__primary-action.mdc-ripple-upgraded {

  &:hover,

  &:focus,

  &:active {

    &.mdc-card__primary-action::before,

    &.mdc-card__primary-action::after {

      background-color: rgba(255, 255, 255, 0) !important;

      opacity: 0 !important;

    }

  }

}


查看完整回答
反對 回復 2022-04-28
  • 3 回答
  • 0 關注
  • 231 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號