zoukankan      html  css  js  c++  java
  • 一手遮天 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

  • 相关阅读:
    【python】浅谈包
    【python】浅谈encode和decode
    【python】环境变量的配置
    Android Studio中添加对HttpClient的支持包
    Android studio中2种build.gradle文件介绍
    服务器响应状态码
    Java UDP实现聊天功能代码【转】
    Java InetAddress.getByAddress()的使用
    IP地址分类(A类 B类 C类 D类 E类)
    Android App发布遇到的问题总结【转】
  • 原文地址:https://www.cnblogs.com/webabcd/p/android_ui_ShapeDemo3.html
Copyright © 2011-2022 走看看