最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

Android小工具自定義view課表

 更新時(shí)間:2022年09月14日 08:54:25   作者:Rose J  
這篇文章主要為大家詳細(xì)介紹了Android小工具自定義view課表,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下

本文實(shí)例為大家分享了Android自定義view課表的具體代碼,供大家參考,具體內(nèi)容如下

這里是模擬課表,數(shù)據(jù)寫(xiě)死了的,不過(guò)也可以通過(guò)抓包獲取教務(wù)系統(tǒng)課表

1.xml文件

<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
? ? xmlns:app="http://schemas.android.com/apk/res-auto"
? ? xmlns:tools="http://schemas.android.com/tools"
? ? android:layout_width="match_parent"
? ? android:background="#A5D6A7"
? ? android:fitsSystemWindows="true"
? ? android:layout_height="match_parent"
? ? tools:context=".KebiaoActivity">

? ? <!-- ? ? ? ?<com.baidu.lbsapi.panoramaview.PanoramaView-->
? ? <!-- ? ? ? ? ? ?android:id="@+id/panorama"-->
? ? <!-- ? ? ? ? ? ?android:layout_width="match_parent"-->
? ? <!-- ? ? ? ? ? ?android:layout_height="match_parent"-->
? ? <!-- ? ? ? ? ? ?android:clickable="true" />-->

? ? <androidx.constraintlayout.widget.ConstraintLayout
? ? ? ? android:layout_width="match_parent"
? ? ? ? android:layout_height="match_parent">
? ? ? ? <androidx.constraintlayout.widget.ConstraintLayout
? ? ? ? ? ? android:id="@+id/constraintLayout"
? ? ? ? ? ? android:layout_width="match_parent"
? ? ? ? ? ? android:layout_height="250dp"
? ? ? ? ? ? app:layout_constraintEnd_toEndOf="parent"
? ? ? ? ? ? app:layout_constraintStart_toStartOf="parent"
? ? ? ? ? ? app:layout_constraintTop_toTopOf="parent">

? ? ? ? ? ? <ImageView
? ? ? ? ? ? ? ? android:id="@+id/back"
? ? ? ? ? ? ? ? android:layout_width="25dp"
? ? ? ? ? ? ? ? android:layout_height="25dp"
? ? ? ? ? ? ? ? android:layout_marginStart="15dp"
? ? ? ? ? ? ? ? app:layout_constraintBottom_toBottomOf="@+id/textView16"
? ? ? ? ? ? ? ? app:layout_constraintStart_toStartOf="parent"
? ? ? ? ? ? ? ? app:layout_constraintTop_toTopOf="@+id/textView16"
? ? ? ? ? ? ? ? app:srcCompat="@mipmap/fanhui"
? ? ? ? ? ? ? ? android:layout_marginLeft="15dp" />

? ? ? ? ? ? <TextView
? ? ? ? ? ? ? ? android:id="@+id/textView16"
? ? ? ? ? ? ? ? android:layout_width="wrap_content"
? ? ? ? ? ? ? ? android:layout_height="wrap_content"
? ? ? ? ? ? ? ? android:text="課表"
? ? ? ? ? ? ? ? android:textColor="#ffffff"
? ? ? ? ? ? ? ? android:textSize="26sp"
? ? ? ? ? ? ? ? android:layout_marginTop="10dp"
? ? ? ? ? ? ? ? app:layout_constraintEnd_toEndOf="parent"
? ? ? ? ? ? ? ? app:layout_constraintHorizontal_bias="0.25"
? ? ? ? ? ? ? ? app:layout_constraintStart_toStartOf="parent"
? ? ? ? ? ? ? ? app:layout_constraintTop_toTopOf="parent" />

? ? ? ? ? ? <TextView
? ? ? ? ? ? ? ? android:id="@+id/ershou"
? ? ? ? ? ? ? ? android:layout_width="wrap_content"
? ? ? ? ? ? ? ? android:layout_height="wrap_content"
? ? ? ? ? ? ? ? android:text="本周課表"
? ? ? ? ? ? ? ? android:textColor="@color/white"
? ? ? ? ? ? ? ? android:textSize="60sp"
? ? ? ? ? ? ? ? app:layout_constraintBottom_toBottomOf="parent"
? ? ? ? ? ? ? ? app:layout_constraintEnd_toEndOf="parent"
? ? ? ? ? ? ? ? app:layout_constraintStart_toStartOf="parent"
? ? ? ? ? ? ? ? app:layout_constraintTop_toTopOf="parent"
? ? ? ? ? ? ? ? app:layout_constraintVertical_bias="0.45" />

? ? ? ? ? ? <TextView
? ? ? ? ? ? ? ? android:layout_width="wrap_content"
? ? ? ? ? ? ? ? android:layout_height="wrap_content"
? ? ? ? ? ? ? ? android:text="Schedule of the week"
? ? ? ? ? ? ? ? android:textColor="@color/white"
? ? ? ? ? ? ? ? android:textSize="20sp"
? ? ? ? ? ? ? ? android:layout_marginTop="10dp"
? ? ? ? ? ? ? ? app:layout_constraintEnd_toEndOf="parent"
? ? ? ? ? ? ? ? app:layout_constraintHorizontal_bias="0.7"
? ? ? ? ? ? ? ? app:layout_constraintStart_toStartOf="parent"
? ? ? ? ? ? ? ? app:layout_constraintTop_toBottomOf="@id/ershou" />
? ? ? ? </androidx.constraintlayout.widget.ConstraintLayout>

? ? ? ? <RelativeLayout
? ? ? ? ? ? android:id="@+id/kebiao22"
? ? ? ? ? ? android:layout_width="match_parent"
? ? ? ? ? ? android:layout_height="wrap_content"
? ? ? ? ? ? app:layout_constraintTop_toBottomOf="@+id/constraintLayout">


? ? ? ? ? ? <TextView android:id="@+id/test_empty"
? ? ? ? ? ? ? ? android:layout_width="wrap_content"
? ? ? ? ? ? ? ? android:layout_height="wrap_content"
? ? ? ? ? ? ? ? android:text="11\n月"
? ? ? ? ? ? ? ? android:gravity="center"

? ? ? ? ? ? ? ? android:background="@drawable/course_text_view_bg"
? ? ? ? ? ? ? ? />

? ? ? ? ? ? <TextView android:id="@+id/test_monday_course"
? ? ? ? ? ? ? ? android:layout_width="wrap_content"
? ? ? ? ? ? ? ? android:layout_height="wrap_content"
? ? ? ? ? ? ? ? android:text="23日\(chéng)n周一"
? ? ? ? ? ? ? ? android:layout_toRightOf="@id/test_empty"
? ? ? ? ? ? ? ? android:background="@drawable/course_text_view_bg"
? ? ? ? ? ? ? ? android:gravity="center"

? ? ? ? ? ? ? ? />

? ? ? ? ? ? <TextView android:id="@+id/test_tuesday_course"
? ? ? ? ? ? ? ? android:layout_width="wrap_content"
? ? ? ? ? ? ? ? android:layout_height="wrap_content"
? ? ? ? ? ? ? ? android:text="24日\(chéng)n周二"
? ? ? ? ? ? ? ? android:layout_toRightOf="@id/test_monday_course"
? ? ? ? ? ? ? ? android:background="@drawable/course_text_view_bg"
? ? ? ? ? ? ? ? android:gravity="center"

? ? ? ? ? ? ? ? />

? ? ? ? ? ? <TextView android:id="@+id/test_wednesday_course"
? ? ? ? ? ? ? ? android:layout_width="wrap_content"
? ? ? ? ? ? ? ? android:layout_height="wrap_content"
? ? ? ? ? ? ? ? android:text="25日\(chéng)n周三"
? ? ? ? ? ? ? ? android:layout_toRightOf="@id/test_tuesday_course"
? ? ? ? ? ? ? ? android:background="@drawable/course_text_view_bg"
? ? ? ? ? ? ? ? android:gravity="center"

? ? ? ? ? ? ? ? />

? ? ? ? ? ? <TextView android:id="@+id/test_thursday_course"
? ? ? ? ? ? ? ? android:layout_width="wrap_content"
? ? ? ? ? ? ? ? android:layout_height="wrap_content"
? ? ? ? ? ? ? ? android:text="26日\(chéng)n周四"
? ? ? ? ? ? ? ? android:layout_toRightOf="@id/test_wednesday_course"
? ? ? ? ? ? ? ? android:background="@drawable/course_text_view_bg"
? ? ? ? ? ? ? ? android:gravity="center"

? ? ? ? ? ? ? ? />

? ? ? ? ? ? <TextView android:id="@+id/test_friday_course"
? ? ? ? ? ? ? ? android:layout_width="wrap_content"
? ? ? ? ? ? ? ? android:layout_height="wrap_content"
? ? ? ? ? ? ? ? android:text="27日\(chéng)n周五"
? ? ? ? ? ? ? ? android:layout_toRightOf="@id/test_thursday_course"
? ? ? ? ? ? ? ? android:background="@drawable/course_text_view_bg"
? ? ? ? ? ? ? ? android:gravity="center"

? ? ? ? ? ? ? ? />

? ? ? ? ? ? <TextView android:id="@+id/test_saturday_course"
? ? ? ? ? ? ? ? android:layout_width="wrap_content"
? ? ? ? ? ? ? ? android:layout_height="wrap_content"
? ? ? ? ? ? ? ? android:text="28日\(chéng)n周六"
? ? ? ? ? ? ? ? android:layout_toRightOf="@id/test_friday_course"
? ? ? ? ? ? ? ? android:background="@drawable/course_text_view_bg"
? ? ? ? ? ? ? ? android:gravity="center"

? ? ? ? ? ? ? ? />

? ? ? ? ? ? <TextView android:id="@+id/test_sunday_course"
? ? ? ? ? ? ? ? android:layout_width="wrap_content"
? ? ? ? ? ? ? ? android:layout_height="wrap_content"
? ? ? ? ? ? ? ? android:text="29日\(chéng)n周日"
? ? ? ? ? ? ? ? android:layout_toRightOf="@id/test_saturday_course"
? ? ? ? ? ? ? ? android:background="@drawable/course_text_view_bg"
? ? ? ? ? ? ? ? android:gravity="center"

? ? ? ? ? ? ? ? />


? ? ? ? </RelativeLayout>
? ? ? ? <RelativeLayout
? ? ? ? ? ? android:layout_width="match_parent"
? ? ? ? ? ? android:layout_height="800dp"
? ? ? ? ? ? android:id="@+id/test_course_rl"
? ? ? ? ? ? app:layout_constraintTop_toBottomOf="@id/kebiao22"
? ? ? ? ? ? >
? ? ? ? </RelativeLayout>

? ? </androidx.constraintlayout.widget.ConstraintLayout>

</ScrollView>

course_text_view_bg

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
? ? >

? ? <solid android:color="#ffffff"/>
? ? <stroke android:width="0.2dp"
? ? ? ? android:color="#AEAAAA"/>

</shape>

2.activity代碼

public class KebiaoActivity extends AppCompatActivity {
? ? /** 第一個(gè)無(wú)內(nèi)容的格子 */
? ? protected TextView empty;
? ? /** 星期一的格子 */
? ? protected TextView monColum;
? ? /** 星期二的格子 */
? ? protected TextView tueColum;
? ? /** 星期三的格子 */
? ? protected TextView wedColum;
? ? /** 星期四的格子 */
? ? protected TextView thrusColum;
? ? /** 星期五的格子 */
? ? protected TextView friColum;
? ? /** 星期六的格子 */
? ? protected TextView satColum;
? ? /** 星期日的格子 */
? ? protected TextView sunColum;
? ? /** 課程表body部分布局 */
? ? protected RelativeLayout course_table_layout;
? ? /** 屏幕寬度 **/
? ? protected int screenWidth;
? ? /** 課程格子平均寬度 **/
? ? protected int aveWidth;
? ? int gridHeight1 = 0;
? ? //(0)對(duì)應(yīng)12節(jié);(2)對(duì)應(yīng)34節(jié);(4)對(duì)應(yīng)56節(jié);(6)對(duì)應(yīng)78節(jié);(8)對(duì)應(yīng)于9 10節(jié)
? ? int[] jieci = {0,2,3,5,4,6,8};
? ? @Override
? ? protected void onCreate(Bundle savedInstanceState) {
? ? ? ? super.onCreate(savedInstanceState);
? ? ? ? if (Build.VERSION.SDK_INT >= 21){
? ? ? ? ? ? View decorView = getWindow().getDecorView();
? ? ? ? ? ? decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
? ? ? ? ? ? getWindow().setStatusBarColor(Color.TRANSPARENT);

? ? ? ? }
? ? ? ? setContentView(R.layout.activity_kebiao);

? ? ? ? ImageView mImageView=findViewById(R.id.back);
? ? ? ? mImageView.setOnClickListener(new View.OnClickListener() {
? ? ? ? ? ? @Override
? ? ? ? ? ? public void onClick(View v) {

? ? ? ? ? ? ? ? finish();
? ? ? ? ? ? }
? ? ? ? });
? ? ? ? //獲得列頭的控件
? ? ? ? empty = (TextView) this.findViewById(R.id.test_empty);
? ? ? ? monColum = (TextView) this.findViewById(R.id.test_monday_course);
? ? ? ? tueColum = (TextView) this.findViewById(R.id.test_tuesday_course);
? ? ? ? wedColum = (TextView) this.findViewById(R.id.test_wednesday_course);
? ? ? ? thrusColum = (TextView) this.findViewById(R.id.test_thursday_course);
? ? ? ? friColum = (TextView) this.findViewById(R.id.test_friday_course);
? ? ? ? satColum ?= (TextView) this.findViewById(R.id.test_saturday_course);
? ? ? ? sunColum = (TextView) this.findViewById(R.id.test_sunday_course);
? ? ? ? course_table_layout = (RelativeLayout) this.findViewById(R.id.test_course_rl);
? ? ? ? DisplayMetrics dm = new DisplayMetrics();
? ? ? ? getWindowManager().getDefaultDisplay().getMetrics(dm);
? ? ? ? //屏幕寬度
? ? ? ? int width = dm.widthPixels;
? ? ? ? //平均寬度
? ? ? ? int aveWidth = width / 8;
? ? ? ? //第一個(gè)空白格子設(shè)置為25寬
? ? ? ? empty.setWidth(aveWidth * 3/4);
? ? ? ? monColum.setWidth(aveWidth * 33/32 + 1);
? ? ? ? tueColum.setWidth(aveWidth * 33/32 + 1);
? ? ? ? wedColum.setWidth(aveWidth * 33/32 + 1);
? ? ? ? thrusColum.setWidth(aveWidth * 33/32 + 1);
? ? ? ? friColum.setWidth(aveWidth * 33/32 + 1);
? ? ? ? satColum.setWidth(aveWidth * 33/32 + 1);
? ? ? ? sunColum.setWidth(aveWidth * 33/32 + 1);
? ? ? ? this.screenWidth = width;
? ? ? ? this.aveWidth = aveWidth;
? ? ? ? int height = dm.heightPixels;
? ? ? ? int gridHeight = height / 10;
? ? ? ? gridHeight1 = gridHeight;
? ? ? ? //設(shè)置課表界面
? ? ? ? //動(dòng)態(tài)生成10 * maxCourseNum個(gè)textview
? ? ? ? for(int i = 1; i <= 12; i ++){

? ? ? ? ? ? for(int j = 1; j <= 8; j ++){

? ? ? ? ? ? ? ? TextView tx = new TextView(KebiaoActivity.this);
? ? ? ? ? ? ? ? tx.setId((i - 1) * 8 ?+ j);
? ? ? ? ? ? ? ? //除了最后一列,都使用course_text_view_bg背景(最后一列沒(méi)有右邊框)
? ? ? ? ? ? ? ? tx.setBackgroundDrawable(KebiaoActivity.this.
? ? ? ? ? ? ? ? ? ? ? ? getResources().getDrawable(R.drawable.course_text_view_bg));
? ? ? ? ? ? ? ? //相對(duì)布局參數(shù)
? ? ? ? ? ? ? ? RelativeLayout.LayoutParams rp = new RelativeLayout.LayoutParams(
? ? ? ? ? ? ? ? ? ? ? ? aveWidth * 33 / 32 + 1,
? ? ? ? ? ? ? ? ? ? ? ? gridHeight);
? ? ? ? ? ? ? ? //文字對(duì)齊方式
? ? ? ? ? ? ? ? tx.setGravity(Gravity.CENTER);
? ? ? ? ? ? ? ? //字體樣式
// ? ? ? ? ? ? ? ?tx.setTextAppearance(this, R.style.courseTableText);
// ? ? ? ? ? ? ? ?//如果是第一列,需要設(shè)置課的序號(hào)(1 到 12)
? ? ? ? ? ? ? ? if(j == 1)
? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? tx.setText(String.valueOf(i));
? ? ? ? ? ? ? ? ? ? rp.width = aveWidth * 3/4;
? ? ? ? ? ? ? ? ? ? //設(shè)置他們的相對(duì)位置
? ? ? ? ? ? ? ? ? ? if(i == 1)
? ? ? ? ? ? ? ? ? ? ? ? rp.addRule(RelativeLayout.BELOW, empty.getId());
? ? ? ? ? ? ? ? ? ? else
? ? ? ? ? ? ? ? ? ? ? ? rp.addRule(RelativeLayout.BELOW, (i - 1) * 8);
? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? else
? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? rp.addRule(RelativeLayout.RIGHT_OF, (i - 1) * 8 ?+ j - 1);
? ? ? ? ? ? ? ? ? ? rp.addRule(RelativeLayout.ALIGN_TOP, (i - 1) * 8 ?+ j - 1);
? ? ? ? ? ? ? ? ? ? tx.setText("");
? ? ? ? ? ? ? ? }

? ? ? ? ? ? ? ? tx.setLayoutParams(rp);
? ? ? ? ? ? ? ? course_table_layout.addView(tx);
? ? ? ? ? ? }
? ? ? ? }

? ? ? ? setCourseMessage(1,jieci[1],"軟件工\n程@含\n浦校區(qū)\n3508教\n室\n");
? ? ? ? setCourseMessage2(2,jieci[0],"嵌入式\n系統(tǒng)...\n@含浦\n校區(qū)\n3204教\n室");
? ? ? ? setCourseMessage(3,jieci[1],"計(jì)算機(jī)\n圖形\n學(xué)@含\n浦校區(qū)\n3310教\n室");
? ? ? ? setCourseMessage2(4,jieci[0],"計(jì)算機(jī)\n網(wǎng)絡(luò)...\n@含浦\n校區(qū)\n3311教\n室");
? ? ? ? setCourseMessage2(5,jieci[0],"嵌入式\n系統(tǒng)...\n@h含浦\n校區(qū)嵌入\n式實(shí)驗(yàn)室");
? ? ? ? setCourseMessage(5,jieci[1],"java...\n@h含浦\n校區(qū)12\n機(jī)房\n(65)");
? ? ? ? setCourseMessage(1,jieci[3],"人工智\n能原\n理@含\n浦校區(qū)\n3306教\n");
? ? ? ? setCourseMessage2(2,jieci[2],"計(jì)算機(jī)\n網(wǎng)絡(luò)...\n@含浦\n校區(qū)\n2204教\n室");
? ? ? ? setCourseMessage(5,jieci[3],"操作系\n統(tǒng)原\n理@含\n浦校區(qū)\n12機(jī)房\n(65)");


? ? }
//菜單
// ? ?@Override
// ? ?public boolean onCreateOptionsMenu(Menu menu) {
// ? ? ? ?// Inflate the menu; this adds items to the action bar if it is present.
// ? ? ? ?getMenuInflater().inflate(R.menu.main, menu);
// ? ? ? ?return true;
// ? ?}

? ? public void setCourseMessage(int xingqi,int jieci,String courseMessage){
? ? ? ? //五種顏色的背景
? ? ? ? int[] background = {R.drawable.course_info_blue, R.drawable.course_info_green,
? ? ? ? ? ? ? ? R.drawable.course_info_red, R.drawable.course_info_zisi,
? ? ? ? ? ? ? ? R.drawable.course_info_yellow};
? ? ? ? // 添加課程信息
? ? ? ? TextView courseInfo = new TextView(this);
? ? ? ? courseInfo.setText(courseMessage);
? ? ? ? //該textview的高度根據(jù)其節(jié)數(shù)的跨度來(lái)設(shè)置
? ? ? ? RelativeLayout.LayoutParams rlp = new RelativeLayout.LayoutParams(
? ? ? ? ? ? ? ? aveWidth * 31 / 32,
? ? ? ? ? ? ? ? (gridHeight1 - 5) * 3 );
? ? ? ? //textview的位置由課程開(kāi)始節(jié)數(shù)和上課的時(shí)間(day of week)確定
? ? ? ? rlp.topMargin = 5 + jieci * gridHeight1;
? ? ? ? rlp.leftMargin = 5;
? ? ? ? // 偏移由這節(jié)課是星期幾決定
? ? ? ? rlp.addRule(RelativeLayout.RIGHT_OF, xingqi);
? ? ? ? //字體劇中
? ? ? ? courseInfo.setGravity(Gravity.CENTER);
? ? ? ? // 設(shè)置一種背景
? ? ? ? Random random = new Random();
? ? ? ? courseInfo.setBackgroundResource(background[random.nextInt(5)]);
? ? ? ? courseInfo.setTextSize(12);
? ? ? ? courseInfo.setLayoutParams(rlp);
? ? ? ? courseInfo.setTextColor(Color.WHITE);
? ? ? ? //設(shè)置不透明度
? ? ? ? courseInfo.getBackground().setAlpha(222);
? ? ? ? course_table_layout.addView(courseInfo);
? ? }
? ? public void setCourseMessage2(int xingqi,int jieci,String courseMessage){
? ? ? ? //五種顏色的背景
? ? ? ? int[] background = {R.drawable.course_info_blue, R.drawable.course_info_green,
? ? ? ? ? ? ? ? R.drawable.course_info_red, R.drawable.course_info_zisi,
? ? ? ? ? ? ? ? R.drawable.course_info_yellow};
? ? ? ? // 添加課程信息
? ? ? ? TextView courseInfo = new TextView(this);
? ? ? ? courseInfo.setText(courseMessage);
? ? ? ? //該textview的高度根據(jù)其節(jié)數(shù)的跨度來(lái)設(shè)置
? ? ? ? RelativeLayout.LayoutParams rlp = new RelativeLayout.LayoutParams(
? ? ? ? ? ? ? ? aveWidth * 31 / 32,
? ? ? ? ? ? ? ? (gridHeight1 - 5) * 2 );
? ? ? ? //textview的位置由課程開(kāi)始節(jié)數(shù)和上課的時(shí)間(day of week)確定
? ? ? ? rlp.topMargin = 5 + jieci * gridHeight1;
? ? ? ? rlp.leftMargin = 5;
? ? ? ? // 偏移由這節(jié)課是星期幾決定
? ? ? ? rlp.addRule(RelativeLayout.RIGHT_OF, xingqi);
? ? ? ? //字體劇中
? ? ? ? courseInfo.setGravity(Gravity.CENTER);
? ? ? ? // 設(shè)置一種背景
? ? ? ? Random random = new Random();
? ? ? ? courseInfo.setBackgroundResource(background[random.nextInt(5)]);
? ? ? ? courseInfo.setTextSize(12);
? ? ? ? courseInfo.setLayoutParams(rlp);
? ? ? ? courseInfo.setTextColor(Color.WHITE);
? ? ? ? //設(shè)置不透明度
? ? ? ? courseInfo.getBackground().setAlpha(222);
? ? ? ? course_table_layout.addView(courseInfo);
? ? }


}

3.資源文件

course_info_blue

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
? ? >


? ? <solid android:color="#4FC3F7"/>

</shape>

course_info_green

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
? ? >


? ? <solid android:color="#81C784"/>

</shape>

course_info_red

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
? ? >


? ? <solid android:color="#E57373"/>

</shape>

course_info_zisi

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
? ? >


? ? <solid android:color="#9575CD"/>

</shape>

course_info_yellow

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
? ? >


? ? <solid android:color="#FFB74D"/>

</shape>

4.運(yùn)行

以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

  • Android webview 內(nèi)存泄露的解決方法

    Android webview 內(nèi)存泄露的解決方法

    這篇文章主要介紹了Android webview 內(nèi)存泄露的解決方法的相關(guān)資料,需要的朋友可以參考下
    2017-07-07
  • Android Dialog中軟鍵盤(pán)的顯示與隱藏的示例

    Android Dialog中軟鍵盤(pán)的顯示與隱藏的示例

    本篇文章主要介紹Android Dialog中軟鍵盤(pán)的顯示與隱藏的示例,這里整理了詳細(xì)的代碼,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下。
    2017-02-02
  • Android中掃描多媒體文件操作詳解

    Android中掃描多媒體文件操作詳解

    這篇文章主要介紹了Android中掃描多媒體文件操作詳解,本文講解了Android中的多媒體文件掃描機(jī)制、如何掃描一個(gè)剛創(chuàng)建的文件、如何掃描多個(gè)文件,需要的朋友可以參考下
    2015-01-01
  • React-Native  Android 與 IOS App使用一份代碼實(shí)現(xiàn)方法

    React-Native Android 與 IOS App使用一份代碼實(shí)現(xiàn)方法

    這篇文章主要介紹了React-Native Android 與 IOS App使用一份代碼實(shí)現(xiàn)方法的相關(guān)資料,這里舉例說(shuō)明,該如何實(shí)現(xiàn)IOS和Android APP 都使用一樣的代碼,需要的朋友可以參考下
    2016-12-12
  • 詳解Android JS相互調(diào)用

    詳解Android JS相互調(diào)用

    這篇文章主要為大家介紹了Android與JS兩者之間的相互調(diào)用,感興趣的小伙伴們可以參考一下
    2016-01-01
  • Android開(kāi)心消消樂(lè)代碼實(shí)例詳解

    Android開(kāi)心消消樂(lè)代碼實(shí)例詳解

    這篇文章主要介紹了Android開(kāi)心消消樂(lè)代碼實(shí)例,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧
    2019-05-05
  • Android Service功能使用示例代碼

    Android Service功能使用示例代碼

    Service是Android中一個(gè)強(qiáng)大的組件,可以用來(lái)執(zhí)行需要在后臺(tái)進(jìn)行的任務(wù),通過(guò)本文的介紹了解如何在Kotlin中創(chuàng)建和使用Service,感興趣的朋友跟隨小編一起看看吧
    2024-06-06
  • 故事講解Activity生命周期(貓的一生)

    故事講解Activity生命周期(貓的一生)

    關(guān)于Android中Activity的生命周期,網(wǎng)上大多數(shù)文章基本都是直接貼圖、翻譯API,比較籠統(tǒng)含糊不清。本文主要用故事講解Activity生命周期。下面跟著小編一起來(lái)看下吧
    2017-03-03
  • Android中用StaticLayout實(shí)現(xiàn)文本繪制自動(dòng)換行詳解

    Android中用StaticLayout實(shí)現(xiàn)文本繪制自動(dòng)換行詳解

    StaticLayout是android中處理文字換行的一個(gè)工具類(lèi),StaticLayout已經(jīng)實(shí)現(xiàn)了文本繪制換行處理,下面這篇文章主要介紹了Android中用StaticLayout實(shí)現(xiàn)文本繪制自動(dòng)換行的相關(guān)資料,需要的朋友可以參考。
    2017-03-03
  • Android獲取手機(jī)文件夾及文件列表的方法

    Android獲取手機(jī)文件夾及文件列表的方法

    這篇文章主要為大家詳細(xì)介紹了Android獲取手機(jī)文件夾及文件列表的方法,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2016-11-11

最新評(píng)論

永济市| 山西省| 云和县| 策勒县| 若尔盖县| 乌兰浩特市| 三门县| 阿拉善右旗| 古丈县| 新田县| 伊通| 扶沟县| 临颍县| 桃园县| 甘洛县| 杨浦区| 吴江市| 卢龙县| 滕州市| 饶河县| 博爱县| 即墨市| 胶南市| 云龙县| 河北省| 乐都县| 木里| 巴青县| 宝坻区| 天全县| 通化市| 丹巴县| 木兰县| 普安县| 浙江省| 迁安市| 开远市| 衡阳市| 建德市| 兴城市| 瑞金市|