zoukankan      html  css  js  c++  java
  • 一手遮天 Android

    项目地址 https://github.com/webabcd/AndroidDemo
    作者 webabcd

    一手遮天 Android - UI: shape 之填充,描边,圆角,尺寸,内部间距

    示例如下:

    /ui/ShapeDemo2.java

    /**
     * shape 之填充,描边,圆角,尺寸,内部间距
     */
    
    package com.webabcd.androiddemo.ui;
    
    import androidx.appcompat.app.AppCompatActivity;
    import android.os.Bundle;
    
    import com.webabcd.androiddemo.R;
    
    public class ShapeDemo2 extends AppCompatActivity {
    
        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_ui_shapedemo2);
        }
    }
    
    

    /layout/activity_ui_shapedemo2.xml

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical">
    
        <!--shape 之填充、描边、圆角,参见 res/drawable/shape_sample_solid_stroke_corners.xml-->
        <TextView
            android:id="@+id/textView1"
            android:layout_width="200dp"
            android:layout_height="200dp"
            android:background="@drawable/shape_sample_solid_stroke_corners" />
    
        <!--shape 之尺寸,参见 res/drawable/shape_sample_size.xml-->
        <TextView
            android:id="@+id/textView2"
            android:layout_width="200dp"
            android:layout_height="100dp"
            android:layout_marginTop="10dp"
            android:background="@color/orange"
            android:drawableBottom="@drawable/shape_sample_size"/>
    
        <!--shape 之内部间距,参见 res/drawable/shape_sample_padding.xml-->
        <TextView
            android:id="@+id/textView3"
            android:layout_width="200dp"
            android:layout_height="100dp"
            android:layout_marginTop="10dp"
            android:text="你好 webabcd"
            android:background="@drawable/shape_sample_padding"/>
    
    </LinearLayout>
    

    项目地址 https://github.com/webabcd/AndroidDemo
    作者 webabcd

  • 相关阅读:
    linux yum命令实践(二)
    linux的yum命令实践
    svn代码回滚命令
    Java连接mysql示例代码
    精品验证码
    稳定性测试,需要对EPC或DIC任务进行翻倍操作,供后续使用
    读取csv
    设置启动参数:禁用密码保存
    gridview超链接列链接方法 (转贴)
    gridview 跨行 跨列(原创)
  • 原文地址:https://www.cnblogs.com/webabcd/p/android_ui_ShapeDemo2.html
Copyright © 2011-2022 走看看