zoukankan      html  css  js  c++  java
  • Android给TextView和EditText等控件设置透明背景、圆角边框

    第一种方法:在drawable文件夹下新建一个文件设置背景样式
    代码:
    在drawable文件夹下面新建text_view_border.xml

    <?xml version="1.0" encoding="UTF-8"?>
    <shape xmlns:android="http://schemas.android.com/apk/res/android">
        <solid android:color="#80858175" />
        <stroke android:width="1dip" android:color="#aea594" />
          <corners android:topLeftRadius="2dp"    
            android:topRightRadius="2dp"     
            android:bottomRightRadius="2dp"    
            android:bottomLeftRadius="2dp"/>
    </shape>
    

    在布局文件调用

    <TextView 
    	android:id="@+id/tv"
    	android:layout_width="wrap_content" 
    	android:layout_height="wrap_content"
    	android:background="@drawable/text_view_border" />
    

    在类文件中调用:

    tv.setBackgroundResource(R.drawable.text_view_border); 
    
  • 相关阅读:
    Logstash IIS日志采集
    Logstash_Apache日志采集
    k8s 资源管理
    获取hdfs集群信息(fs.defaultFS)
    PHP CMS的pc标签
    流程
    PHP复习
    权限管理
    注册审核
    简单的文件管理程序练习
  • 原文地址:https://www.cnblogs.com/banxian/p/3811120.html
Copyright © 2011-2022 走看看