EditText圆角:

一、在drawable下面添加xml文件rounded_editview.xml


复制代码 代码如下:

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">
    <solid android:color="#FFFFFF"></solid>
    <padding android:left="10dp"
        android:top="10dp"
        android:right="10dp"
        android:bottom="10dp"></padding>
    <corners android:radius="15dp"></corners>
</shape>

二、在EditText的background属性中引用这个xml


复制代码 代码如下:

<EditText
        android:id="@+id/et_username"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:inputType="text"
        android:background="@drawable/rounded_editview"
        android:hint="@string/text_hint_username"/> toolbar左边空格问题
在xml中添加如下代码:

<android.support.v7.widget.Toolbar
android:background="@drawable/bg"
android:layout_width="match_parent"
android:layout_height="56dp"
android:fitsSystemWindows="true"
app:contentInsetLeft="0dp"
app:contentInsetStart="0dp"
>
 

沉浸式状态栏:
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
            getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
            getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
        }
在根目录上加上这个
android:fitsSystemWindows="true"

可以解决直接顶到顶部的问题

隐藏:

this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);

隐藏状态栏,toolbar前面空格问题,editText圆角的更多相关文章

  1. Android实现隐藏状态栏和标题栏

    隐藏标题栏需要使用预定义样式:android:theme=”@android:style/Theme.NoTitleBar”. 隐藏状态栏:android:theme=”@android:style/ ...

  2. iOS 隐藏状态栏

    1.整个项目隐藏状态栏 在Targets->General->勾选中Hide status bar . 整个项目隐藏状态栏 2.单个界面隐藏状态栏,例如登录注册页面 1.首先在info.p ...

  3. Android隐藏状态栏、导航栏

    Android隐藏状态栏.导航栏 private void hideStatusNavigationBar(){ if(Build.VERSION.SDK_INT<16){ this.getWi ...

  4. iOS7隐藏状态栏 statusBar

    转:http://blog.csdn.net/dqjyong/article/details/17896145 评:通过这点变化,可以看出苹果倾向于使用delegate取代全局变量. IOS7中,不仅 ...

  5. 如何在iOS 7.0中隐藏状态栏

    使用Cordova做了一个小项目,在原来iOS6的时候显示挺好,升级为iOS7后,每次App启动后都会显示状态栏,而且状态栏和App的标题栏重叠在一起,非常难看,因此需要将状态栏隐藏起来.   首先, ...

  6. Android隐藏状态栏实现沉浸式体验

    转自: Android状态栏微技巧,带你真正理解沉浸式模式 什么叫沉浸式? 根据百度百科上的定义,沉浸式就是要给用户提供完全沉浸的体验,使用户有一种置身于虚拟世界之中的感觉. 那么对应到Android ...

  7. iOS之隐藏状态栏

    iOS7中,不仅应用的风格有一定的变化,状态栏变化比较大,我们可以看到UIViewController的状态栏与导航栏基本是一体的.因此UIVIEWCONTROLLER的hide/show状态的方法也 ...

  8. iOS开发- 隐藏状态栏(电池栏)

    分为两种情况: 1. 想要隐藏某个视图的状态栏, 比方说, 从界面A, push 到界面B的时候, 界面A原本显示状态栏, 然而我们须要界面B不显示状态栏. 这时候, 能够这样做: 在B中实现: - ...

  9. ios7学习之路六(隐藏状态栏 )

    方法一(代码设置): 现在ios7已经更改为透明,并且不占用屏幕高度.其中隐藏及显示的方法如下: 在uiviewcontroller的子类下,调用:      if ([self respondsTo ...

随机推荐

  1. js将时间戳转换为日期类型

    function getLocalTime(nS) {       var date = new Date(nS);    Y = date.getFullYear() + '年';    M = ( ...

  2. [Linux]目录x权限对文件操作的影响

    问题 我们常使用linux以下命令 cd 进入目录 ls 列出目录中的文件 或者直接打开目录中的文件 以上操作对于目录权限位的设置来说,是有一定迷惑性的,如表格所示   cd进入该目录 cd进入该目录 ...

  3. pl/sql学习(6): 引号/程序调试/列中的字符串合并/正则表达式

    有关自治事务的问题: https://www.cnblogs.com/princessd8251/p/4132649.html 我在plsql development学习中遇到的常见问题: (一) 引 ...

  4. docker 进阶

    docker 常用命令: docker  pull hub.c.163.com/library/mysql:latest  #这是从网址下载下来mysql镜像 docker run  -d -p 88 ...

  5. Three teachers who make differences in my life

    人生路漫漫,从小到大,经历过九年义务教育的我们也受到过很多老师的熏陶,而已经进入大学的我也会回想起那些给我带来别样意义的老师们. 亲爱的老李-老李是我初中的班主任,也是我的历史老师.依稀记得上他的课会 ...

  6. 金蝶K/3 跟踪语句_业务单据

    跟踪语句_业务单据_BOM select * from t_TableDescription where Ftablename like '%ICBOM%' order by FFieldName o ...

  7. Elasticsearch为记录添加时间戳timestamp

    https://blog.csdn.net/peterwanghao/article/details/76577546

  8. python中的while循环和for循环

    1.while循环 Gif 演示 Python while 语句执行过程 while 语句时还有另外两个重要的命令 continue,break 来跳过循环,continue 用于跳过该次循环,bre ...

  9. Service-Level Agreement (服务水平协议)

    Service-Level Agreement (服务水平协议) SLA是为负载测试场景定义的具体目标.例如,评测脚本中任意数量事务的平均响应时间,可以定义具体的目标或阈值.测试运行结束之后,Load ...

  10. Palindrome POJ - 3974 (字符串hash+二分)

    Andy the smart computer science student was attending an algorithms class when the professor asked t ...