zoukankan      html  css  js  c++  java
  • xamarin android制作圆角边框

    xamarin android制作圆角边框

    效果图如下:

    关键代码:

    drawable文件夹新建shape_corner_down.xml

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

    布局layout文件代码

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:orientation="vertical"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="#FFFFFF">
        <RelativeLayout
            android:id="@+id/login_div"
            android:layout_width="fill_parent"
            android:layout_height="150dip"
            android:padding="15dip"
            android:layout_margin="15dip"
            android:background="@drawable/shape_corner_down" />
    </LinearLayout>
    

    xamarin android制作圆角边框原理:

    drawable文件夹下新建的xml文件 shape:表示一个形状 ,solid:填充的颜色,corners:表示四个方向的弯曲度,如果四个角度都是一样的可以直接写成<corners android:radius="5dp" />  ,stroke表示边框

  • 相关阅读:
    tars go版本源码分析
    goim源码阅读
    vue weixin源码解读
    避免加锁的骚操作
    git一些常用操作
    eclipse 的习惯配置
    ai资源站
    转载 github上的一些安全资源收集
    转载 一个统计代码行数的python脚本
    C语言开发工具
  • 原文地址:https://www.cnblogs.com/zhangmumu/p/7374826.html
Copyright © 2011-2022 走看看