当前位置: 首页 > news >正文

网站秒收录工具如何在百度上做产品推广

网站秒收录工具,如何在百度上做产品推广,自己做网站服务器,网络营销专业主修课程正如题名,在Android中的EditText是自带内边距的,常规而言设置背景为null即可,但是因为使用了并不熟悉的声明式框架,本是几分钟解决的事儿,却花费了小半天~ 其实这只是一个很简单的小需求,不想却遇到了一些小…

正如题名,在Android中的EditText是自带内边距的,常规而言设置背景为null即可,但是因为使用了并不熟悉的声明式框架,本是几分钟解决的事儿,却花费了小半天~

其实这只是一个很简单的小需求,不想却遇到了一些小问题,索性花一些时间去打牢一下基础

    • 引发场景
    • 常见场景
      • 原始场景
      • 设置 background 场景
        • background = null
        • background = 色值
        • background = drawable
      • 设置 padding
        • 仅设置 padding
        • 设置 padding + background
    • Demo测试
      • 效果
      • xml

引发场景

此场景正是我目前开发中需要适配的一个UI效果,也因由此我又写了个Demo,经过测试了一番后,总结记录于此

在这里插入图片描述

我的思考

针对于整体布局而言,以下俩种方式都可以使用(初始出问题的时候我也都试过,但当时没找到问题的关键)

  • 线性垂直布局+帧布局(EditText+TextView)
  • 线性垂直布局+线性水平布局(EditText+TextView)

总体布局方案搞定后,主要就是针对于EditText常规处理;

  • 按理我仅需设置 background = null 即可,但是设置过后仅仅只是去除了底部线条,上下边距依旧存在;
  • 我给 EditText 设置了固定高度,但导致EditText 显示不全(被遮挡),内边距依旧存在且覆盖在输入内容之上

因为我使用的是 声明式布局+splitties框架 ,所以我就在想会不会是框架中有进行特殊设置?为了排除问题,我先拿同等处理方式在xml试了一下,发现可以达到预期效果;所以 background = null 的方式是可行的,但还不足够实现我们需求,然后我睡了一觉后想:“既然是上下边距的问题,那去除内边距应该可以”,经过尝试最终采用了 设置 padding + background 的方式

我想现在采用这种布局方式的朋友应该还不是很多,故此留一份伪代码,用于各位了解我所遇场景和解决方式

在这里插入图片描述

关于在排错时,我查看了框架是否内部有做设置,但是简单看来好像并未设置 theme 之类的

在这里插入图片描述

然后我想着看看EditText的源码,但是追的可能不太对,等以后有时间在专研一下

搜索之后,有人说 EditText 默认的 background 是一个 InsetDrawable ,关于InsetDrawable 可自行查找学习一下,我以下仅做简单记录

在这里插入图片描述


常见场景

以下场景仅是我个人经验而已,从原始的EditText效果 -> 去除原始默认效果 的处理方式和对应场景

原始场景

未经过任何设置的原始EditText,默认会有底部线条+上下内边距

在这里插入图片描述

在这里插入图片描述 示例

    <EditTextandroid:layout_width="match_parent"android:layout_height="wrap_content"android:hint="原始的EditText" />

设置 background 场景

通过设置 EditTextbackground ,可以去除其默认效果(边距和底部横线),我已知常见的有三种

  • null (较常用)
  • 色值
  • drawable(可以是shape,也可以是图片)

在这里插入图片描述

在这里插入图片描述 示例

background = null

    <EditTextandroid:layout_width="match_parent"android:layout_height="wrap_content"android:layout_marginTop="10dp"android:background="@null"android:hint="background 为 null" />

background = 色值

    <EditTextandroid:layout_width="match_parent"android:layout_height="wrap_content"android:layout_marginTop="10dp"android:background="#00000000"android:hint="background 为 色值" />

background = drawable

如不设置背景图,默认会采用背景图高度

    <EditTextandroid:layout_width="match_parent"android:layout_height="40dp"android:layout_marginTop="10dp"android:background="@drawable/icon_font_bg"android:hint="background 为 drawable" />

设置 padding

因为默认效果有上下边距,所以我们也可以通过设置 padding,达到基本效果

仅设置 padding

当仅设置 padding 的话,默认的底部线条并不会消失

在这里插入图片描述
在这里插入图片描述 示例

    <EditTextandroid:layout_width="match_parent"android:layout_height="wrap_content"android:layout_marginTop="10dp"android:hint="padding 为 0"android:padding="0dp" />

设置 padding + background

我所遇到的问题,就是通过这种方式达到理想效果的

在这里插入图片描述
在这里插入图片描述 示例

    <EditTextandroid:layout_width="match_parent"android:layout_height="wrap_content"android:background="null"android:hint="padding=0 + background=null"android:padding="0dp" />

Demo测试

这就是我用于测试 EditText 显示场景的Demo,备忘于此

效果

在这里插入图片描述

xml

<?xml version="1.0" encoding="utf-8"?>
<androidx.appcompat.widget.LinearLayoutCompat 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"android:orientation="vertical"tools:context=".MainActivity"><EditTextandroid:layout_width="match_parent"android:layout_height="wrap_content"android:hint="原始的EditText" /><EditTextandroid:layout_width="match_parent"android:layout_height="wrap_content"android:layout_marginTop="10dp"android:background="@null"android:hint="background 为 null" /><EditTextandroid:layout_width="match_parent"android:layout_height="wrap_content"android:layout_marginTop="10dp"android:background="#00000000"android:hint="background 为 色值" /><EditTextandroid:layout_width="match_parent"android:layout_height="40dp"android:layout_marginTop="10dp"android:background="@drawable/icon_font_bg"android:hint="background 为 drawable" /><EditTextandroid:layout_width="match_parent"android:layout_height="wrap_content"android:layout_marginTop="10dp"android:hint="padding 为 0"android:padding="0dp" /><EditTextandroid:layout_width="match_parent"android:layout_height="wrap_content"android:layout_marginTop="10dp"android:background="null"android:hint="padding=0 + background=null"android:padding="0dp" /></androidx.appcompat.widget.LinearLayoutCompat>
http://www.dinnco.com/news/13348.html

相关文章:

  • 深圳外贸seo网站推广深圳英文站seo
  • 医院如何做网站策划轻饮食网络推广方案
  • 网站建设怎么添加视频百度网页翻译
  • 网站模板做网站seo提供服务
  • 做赛事预测网站seo云优化软件
  • 美食分享网站设计国家免费技能培训
  • 辛集建设局官方网站seo培训学院官网
  • 北京网站开发网站建设价格今天高清视频免费播放
  • 广告平面设计基础知识惠州搜索引擎seo
  • 做网站如何上传网站快速收录技术
  • 做外贸的网站平台有哪些内容seo网络推广是干嘛的
  • 制作网站找哪个公司好谷歌关键词工具
  • 京东联盟网站推广位怎么做seo关键词排名优化的方法
  • 社区网站的建设seo优化软件免费
  • 建设厅网站查询网络营销百度百科
  • 在线logo制作生成免费网站制作网页多少钱
  • 心得网站建设三只松鼠网络营销策略
  • 专业的网站开发服务aso优化排名违法吗
  • 做网站得叫什么如何提高网站搜索排名
  • 企业在网站建设上的不足免费的推广引流软件
  • 从0开始做网站西安专业做网站公司
  • 那个网站做车险分期线上推广产品
  • 湖南长沙邮政编码南昌seo公司
  • 海淀区住房和城乡建设委员会官方网站网站推广app
  • b2b网站分类网站关键词怎么优化排名
  • 网站建设工具seo 优化案例
  • 长沙专门做网站公司百度seo排名优
  • 成都建设网站那家好全国疫情高中低风险区一览表
  • 虫虫 wordpress 群发google seo是什么
  • 怎样做txt电子书下载网站手机百度2020