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

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

將高程應用于 TextInputLayout

將高程應用于 TextInputLayout

慕虎7371278 2022-10-20 17:17:47
我正在嘗試創建一個與 Google 照片應用程序中的工具欄具有相似樣式的搜索欄 - 即用陰影四舍五入。我們使用 Material 庫中的 TextInputLayout 作為片段的唯一子元素(它在父片段的頂部膨脹)。以下是我目前所擁有的(一旦我可以購買海拔高度,我就有一個可用作背景的可繪制對象,為了清楚起見,我省略了它)<?xml version="1.0" encoding="utf-8"?><androidx.constraintlayout.widget.ConstraintLayout 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="match_parent"    tools:context=".Fragments.SearchFragment">        <com.google.android.material.textfield.TextInputLayout            android:id="@+id/searchTextInputLayout"            android:layout_width="match_parent"            android:layout_height="wrap_content"            android:paddingTop="8dp"            app:layout_constraintEnd_toEndOf="parent"            app:layout_constraintStart_toStartOf="parent"            app:layout_constraintTop_toTopOf="parent">                <com.google.android.material.textfield.TextInputEditText                    android:id="@+id/searchTextInputEditText"                    android:layout_width="match_parent"                    android:layout_height="wrap_content"                    android:layout_marginStart="8dp"                    android:layout_marginEnd="8dp"                    android:paddingStart="24dp"                    android:paddingEnd="24dp"                    android:background="#ffffff"                    android:elevation="20dp"                    android:drawableStart="@drawable/ic_menu_black_24dp"                    android:hint="Search" />        </com.google.android.material.textfield.TextInputLayout></androidx.constraintlayout.widget.ConstraintLayout><!--android:background="@drawable/searchbar_rounded"-->我在這里遺漏了一些明顯的東西,還是這是 TextInputLayout 的限制?
查看完整描述

1 回答

?
素胚勾勒不出你

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

將 textView 放在 cardView 里面,它肯定會產生陰影 cardView 的例子


<android.support.v7.widget.CardView 

    xmlns:android="http://schemas.android.com/apk/res/android"

    xmlns:card_view="http://schemas.android.com/apk/res-auto"

    android:layout_width="match_parent"

    android:layout_height="match_parent"

    android:layout_margin="6dp"

    card_view:cardUseCompatPadding="true"

    card_view:cardElevation="4dp"

    card_view:cardCornerRadius="3dp">


查看完整回答
反對 回復 2022-10-20
  • 1 回答
  • 0 關注
  • 87 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號

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