简体   繁体   English

从 AutoCompleteTextView 中删除顶部和底部的黑色边框

[英]Remove top and bottom black borders from AutoCompleteTextView

I'm experiencing a problem with the AutoCompleteTextView dropdown component.我遇到了 AutoCompleteTextView 下拉组件的问题。

As you can see from the image below, there are those black borders inside the popup that I cannot get rid of.从下图中可以看出,弹出窗口中有一些我无法摆脱的黑色边框。

Black borders:黑色边框:

后边框

I'm an Android noob, and I already tried basically everything with any success.我是一个 Android 菜鸟,我基本上已经尝试了一切并取得了成功。

Below the code, I'm using.在代码下方,我正在使用。

activity.xml:活动.xml:

<com.google.android.material.textfield.TextInputLayout
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_weight="3"
                        android:hint="Categoria"
                        android:layout_marginRight="@dimen/spacing_xlarge"
                        app:hintEnabled="true"
                        app:boxBackgroundColor="@color/white"
                        style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu">

                    <AutoCompleteTextView
                            android:dropDownSelector="@color/white"
                            android:id="@+id/private_place_dropdown"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:dropDownHeight="300dp"
                            android:inputType="none"
                            android:drawableTint="@color/white"
                            android:backgroundTint="@color/white"
                            android:editable="false"
                            android:textColor="@color/piumaBaseColor"
                            />

                </com.google.android.material.textfield.TextInputLayout>

dropdown_menu_popup_item.xml: dropdown_menu_popup_item.xml:

<TextView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="50dp"
    android:paddingLeft="@dimen/spacing_medium"
    android:paddingRight="@dimen/spacing_medium"
    android:paddingBottom="@dimen/spacing_medium"
    android:ellipsize="end"
    android:maxLines="1"
    android:textAppearance="@style/TextAppearance.MaterialComponents.Body1"
    android:gravity="center_vertical"
    android:background="@color/white"
    android:backgroundTint="@color/white"
    android:textColor="@color/grey_extradark"
    android:text="test"/>

Can you please help me?你能帮我么? Thank you a lot!十分感谢!

This dark lined are additional background from PopupBackgroundView .这个黑线是来自PopupBackgroundView的附加背景。 For fix the issue just use for background the same surfaceColor as you have in your theme要解决此问题,只需使用与主题中相同的surfaceColor作为背景

<style name="AppTheme" parent="Theme.MaterialComponents.Light">
    ...
    <item name="colorSurface">#FFFFFF</item>
</style>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 AutoCompleteTextView - 如何从顶部和底部删除边距? - AutoCompleteTextView - How to remove margin from top and bottom? 如何从 android 中的 VLCVideoLayout 中删除顶部和底部黑条 - How to remove top and bottom black bar from VLCVideoLayout in android Android对话框片段消除了黑色边框(顶部和底部) - Android Dialog fragment eliminate black borders (top & bottom) iPhone 11 模拟器中的 React Native 应用程序周围有顶部和底部黑色边框 - Top & Bottom black borders are surrounding the react native app in iPhone 11 simulator PageViewer白色边框在顶部和底部 - PageViewer white borders on top and bottom 从AutoCompleteTextView删除字母 - Remove letter from AutoCompleteTextView 关闭 Google 登录时从上到下出现黑色条纹 - Flutter - Black stripe from top to bottom when Google Sign In dismissed - Flutter Android活动从底部到顶部以及从顶部到底部的黑色背景过渡 - Android activity transition from bottom to top and top to bottom black background issue 在android中删除ListView顶部和底部的阴影? - Remove shadow from top and bottom of ListView in android? 如何从Android屏幕底部删除黑条菜单? - How to remove black bar menu from the bottom of android screen?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM