• 一手遮天 Android


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

    一手遮天 Android - UI: shape 形状(矩形,圆形,环形,直线)

    示例如下:

    /ui/ShapeDemo3.java

    /**
     * shape 形状(矩形,圆形,环形,直线)
     */
    
    package com.webabcd.androiddemo.ui;
    
    import androidx.appcompat.app.AppCompatActivity;
    import android.os.Bundle;
    
    import com.webabcd.androiddemo.R;
    
    public class ShapeDemo3 extends AppCompatActivity {
    
        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_ui_shapedemo3);
        }
    }
    
    

    /layout/activity_ui_shapedemo3.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_rectangle.xml-->
        <TextView
            android:id="@+id/textView1"
            android:layout_width="200dp"
            android:layout_height="100dp"
            android:background="@drawable/shape_sample_rectangle" />
    
        <!--圆形 shape,参见 res/drawable/shape_sample_oval.xml-->
        <TextView
            android:id="@+id/textView2"
            android:layout_width="200dp"
            android:layout_height="100dp"
            android:layout_marginTop="10dp"
            android:background="@drawable/shape_sample_oval" />
    
        <!--环形 shape,参见 res/drawable/shape_sample_ring.xml-->
        <TextView
            android:id="@+id/textView3"
            android:layout_width="200dp"
            android:layout_height="100dp"
            android:layout_marginTop="10dp"
            android:background="@drawable/shape_sample_ring" />
    
        <!--直线 shape,参见 res/drawable/shape_sample_line.xml-->
        <TextView
            android:id="@+id/textView4"
            android:layout_width="200dp"
            android:layout_height="100dp"
            android:layout_marginTop="10dp"
            android:background="@drawable/shape_sample_line" />
    
    </LinearLayout>
    

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

  • 相关阅读:
    [Android-NDK编译] ndk 编译 c++ 兼容性问题汇总整理
    [云计算] 001.云计算简介
    eatwhatApp开发实战(十一)
    eatwhatApp开发实战(十)
    [Unity2d系列教程] 002.引用外部DLL
    Istio Sidecar
    Kubernetes Dashborad 搭建
    Istio 1.6架构及性能
    kubeadm 搭建kubernetes集群环境
    docker 安装
  • 原文地址:https://www.cnblogs.com/webabcd/p/android_ui_ShapeDemo3.html
Copyright © 2020-2023  润新知