本文介绍了如何修复的EditText复制/粘贴布局的bug的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在自己布局的EditText,我用它来搜索。但在我的布局顶部选择的文本的EditText错误。
I have own EditText in layout, I use it to search. but select the text of into EditText bug in top of my layout.
请参见下图了解我的意思结果
please see below photo to understand my mean
布局code:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:background="#000"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.tellfa.smsbox.Search_page">
<include
android:id="@+id/app_bar"
layout="@layout/app_bar" />
<EditText
android:id="@+id/search_bar_text"
android:layout_width="fill_parent"
android:layout_height="50dp"
android:background="@color/primaryColor"
android:gravity="right|center_vertical"
android:hint="@string/search_page_hing"
android:maxLength="25"
android:maxLines="1"
android:singleLine="true"
android:textColor="@color/search_hint"
android:textColorHint="@color/hint_foreground_material_dark"
android:textSize="20sp"
android:windowSoftInputMode="stateAlwaysHidden" />
Appbar code:
Appbar code :
<android.support.v7.widget.Toolbar
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/primaryColor"
app:popupTheme="@style/ThemeOverlay.AppCompat.Dark"
app:theme="@style/MyCustomToolbarTheme"
android:paddingTop="15dp"
>
如何解决它或更改布局的背景上?
how to fix it or change top of layout background ?
推荐答案
更新您的布局,如:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent" >
..
</RelativeLayout>
另外,还要确保你的项目使用的风格
Also make sure that your project uses style
Theme.AppCompat.Light.NoActionBar
告诉我,如果你的作品!
Tell me if it works for you!
这篇关于如何修复的EditText复制/粘贴布局的bug的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!