国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

Android快速入門-----用戶界面(上)UI組件(1)

這篇具有很好參考價(jià)值的文章主要介紹了Android快速入門-----用戶界面(上)UI組件(1)。希望對(duì)大家有所幫助。如果存在錯(cuò)誤或未考慮完全的地方,請(qǐng)大家不吝賜教,您也可以點(diǎn)擊"舉報(bào)違法"按鈕提交疑問(wèn)。

@Override

public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {

if(isChecked){

// 提示

Toast.makeText(SimpleComponActivity.this, cd_simple_pingpang.getText().toString(), 0).show();

}

}

});

cd_simple_foot.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {

@Override

public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {

if(isChecked){

// 提示

Toast.makeText(SimpleComponActivity.this, cd_simple_foot.getText().toString(), 0).show();

}

}

});

cd_simple_basket.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {

@Override

public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {

if(isChecked){

// 提示

Toast.makeText(SimpleComponActivity.this, cd_simple_basket.getText().toString(), 0).show();

}

}

});

(6)RadioGroup/RadioButtion:單選框

Android快速入門-----用戶界面(上)UI組件(1),程序員,android,ui,linux

a、修改activity_simple_compon.xml

Android快速入門-----用戶界面(上)UI組件(1),程序員,android,ui,linux

<RadioGroup

android:id=“@+id/rd_simple_sex”

android:layout_width=“wrap_content”

android:layout_height=“wrap_content”

android:orientation=“horizontal”

<RadioButton

android:id=“@+id/rb_simple_male”

android:layout_width=“wrap_content”

android:layout_height=“wrap_content”

android:text=“男” />

<RadioButton

android:id=“@+id/rb_simple_female”

android:layout_width=“wrap_content”

android:layout_height=“wrap_content”

android:checked=“true”

android:text=“女” />

<RadioButton

android:id=“@+id/rb_simple_nomale”

android:layout_width=“wrap_content”

android:layout_height=“wrap_content”

android:text=“東方不敗” />

b、修改SimpleComponActivity

Android快速入門-----用戶界面(上)UI組件(1),程序員,android,ui,linux

Android快速入門-----用戶界面(上)UI組件(1),程序員,android,ui,linux

//6、RadioGroup/RadioNutton

rd_simple_sex = (RadioGroup)findViewById(R.id.rd_simple_sex);

rd_simple_sex.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {

@Override

public void onCheckedChanged(RadioGroup group, int checkedId) {//checkedId,選中的radioButton的id

// 找到選中的radioButton

RadioButton radioButton = (RadioButton)findViewById(checkedId);

//得到文本

String sex = radioButton.getText().toString();

//提示

Toast.makeText(SimpleComponActivity.this,sex, 0).show();

}

} );

c、測(cè)試

Android快速入門-----用戶界面(上)UI組件(1),程序員,android,ui,linux

(7)菜單Component(Menu)

Android快速入門-----用戶界面(上)UI組件(1),程序員,android,ui,linux

a、修改MainActivity

Android快速入門-----用戶界面(上)UI組件(1),程序員,android,ui,linux

b、創(chuàng)建MenuActivity,修改activity_menu.xml

Android快速入門-----用戶界面(上)UI組件(1),程序員,android,ui,linux

<LinearLayout xmlns:android=“http://schemas.android.com/apk/res/android”

android:layout_width=“fill_parent”

android:layout_height=“fill_parent”

android:orientation=“vertical”

<Button

android:id=“@+id/btn_test_show_cm”

android:layout_width=“match_parent”

android:layout_height=“wrap_content”

android:text=“顯示ContextMenu”

/>

<TextView

android:layout_width=“fill_parent”

android:layout_height=“wrap_content”

android:text=“1、點(diǎn)擊menu顯示選項(xiàng)菜單\n2.長(zhǎng)按按鈕顯示上下文菜單”

android:textSize=“25dp”

/>

Android快速入門-----用戶界面(上)UI組件(1),程序員,android,ui,linux

1)關(guān)于Menu的三個(gè)問(wèn)題

Android快速入門-----用戶界面(上)UI組件(1),程序員,android,ui,linux

2)OptionMenu

Android快速入門-----用戶界面(上)UI組件(1),程序員,android,ui,linux

a、修改MenuActivity(實(shí)現(xiàn)OptionMenu)點(diǎn)擊Menu鍵實(shí)現(xiàn)上述效果(menu.add())

Android快速入門-----用戶界面(上)UI組件(1),程序員,android,ui,linux

b、測(cè)試

Android快速入門-----用戶界面(上)UI組件(1),程序員,android,ui,linux

c、通過(guò)定義菜單文件的方式實(shí)現(xiàn)上述功能(創(chuàng)建菜單文件)

在res上創(chuàng)建XML文件

Android快速入門-----用戶界面(上)UI組件(1),程序員,android,ui,linux

Android快速入門-----用戶界面(上)UI組件(1),程序員,android,ui,linux

Android快速入門-----用戶界面(上)UI組件(1),程序員,android,ui,linux

<?xml version="1.0" encoding="utf-8"?>

<item

android:id=“@+id/add”

android:title=“添加2”>

<item

android:id=“@+id/delete”

android:title=“刪除2”>

d、修改MenuActivity

Android快速入門-----用戶界面(上)UI組件(1),程序員,android,ui,linux

//用來(lái)顯示optionmenu的方法:向menu當(dāng)中添加Item

@Override

public boolean onCreateOptionsMenu(Menu menu) {

//加載菜單文件的方式

//1、得到菜單的加載器對(duì)象

MenuInflater menuInflater = getMenuInflater();

//2、加載菜單文件

menuInflater.inflate(R.menu.option_menu, menu);

return super.onCreateOptionsMenu(menu);

}

實(shí)現(xiàn)效果和上面相同

Android快速入門-----用戶界面(上)UI組件(1),程序員,android,ui,linux

3)選擇某個(gè)MenuItem時(shí)如何響應(yīng),修改MenuActivity

重寫(xiě)一個(gè)方法onOptionsItemSelected

Android快速入門-----用戶界面(上)UI組件(1),程序員,android,ui,linux

@Override

public boolean onOptionsItemSelected(MenuItem item) {

switch (item.getItemId()) {

case R.id.add:

Toast.makeText(this, “添加”, 0).show();

break;

case R.id.delete:

Toast.makeText(this, “刪除”, 0).show();

break;

default:

break;

}

return super.onOptionsItemSelected(item);

}

(8)ContextMenu:上下文菜單

Android快速入門-----用戶界面(上)UI組件(1),程序員,android,ui,linux

ContextMenu

1)如何觸發(fā)Menu的顯示?長(zhǎng)按某一個(gè)視圖,修改MenuActivity

Android快速入門-----用戶界面(上)UI組件(1),程序員,android,ui,linux

Android快速入門-----用戶界面(上)UI組件(1),程序員,android,ui,linux

Android快速入門-----用戶界面(上)UI組件(1),程序員,android,ui,linux

2)向Menu當(dāng)中添加MenuItem,重寫(xiě)onCreateContextMenu(),menu.add()
3)選擇某一個(gè)MenuItem時(shí)如何響應(yīng)?重寫(xiě)onContextItemSelected(),根據(jù)itemId做響應(yīng)(修改MenuActivity)

Android快速入門-----用戶界面(上)UI組件(1),程序員,android,ui,linux

@Override

public boolean onContextItemSelected(MenuItem item) {

switch (item.getItemId()) {

case 1:

Toast.makeText(this, “添加”, 0).show();

break;

case 2:

Toast.makeText(this, “刪除”, 0).show();

break;

default:

break;

}

return super.onContextItemSelected(item);

}

Android快速入門-----用戶界面(上)UI組件(1),程序員,android,ui,linux

Android快速入門-----用戶界面(上)UI組件(1),程序員,android,ui,linux

Android快速入門-----用戶界面(上)UI組件(1),程序員,android,ui,linux

Android快速入門-----用戶界面(上)UI組件(1),程序員,android,ui,linux

(9)進(jìn)度條Component

Android快速入門-----用戶界面(上)UI組件(1),程序員,android,ui,linux

1)Progressbar進(jìn)度條

Android快速入門-----用戶界面(上)UI組件(1),程序員,android,ui,linux

Android快速入門-----用戶界面(上)UI組件(1),程序員,android,ui,linux

2)SeekBar:可以手動(dòng)滑動(dòng)的進(jìn)度條

Android快速入門-----用戶界面(上)UI組件(1),程序員,android,ui,linux

3)功能實(shí)現(xiàn)
a、修改MainActivity

Android快速入門-----用戶界面(上)UI組件(1),程序員,android,ui,linux

b、創(chuàng)建ProgressActivity

Android快速入門-----用戶界面(上)UI組件(1),程序員,android,ui,linux

c、修改activity_progress.xml

Android快速入門-----用戶界面(上)UI組件(1),程序員,android,ui,linux

<LinearLayout xmlns:android=“http://schemas.android.com/apk/res/android”

android:layout_width=“fill_parent”

android:layout_height=“fill_parent”

android:orientation=“vertical” >

<LinearLayout

android:id=“@+id/ll_progress_loading”

android:layout_width=“match_parent”

android:layout_height=“wrap_content”

android:gravity=“center”

<ProgressBar

android:layout_width=“wrap_content”

android:layout_height=“wrap_content” />

<TextView

android:layout_width=“wrap_content”

android:layout_height=“wrap_content”

android:text=“正在加載中…” />

<ProgressBar

android:id=“@+id/pb_progress_loading”

style=“?android:attr/progressBarStyleHorizontal”

android:layout_width=“fill_parent”

android:layout_height=“wrap_content”

android:progress=“30”

/>

<SeekBar

android:id=“@+id/sb_progress_loading”

android:layout_width=“match_parent”

android:layout_height=“wrap_content” />

<TextView

android:layout_width=“fill_parent”

android:layout_height=“wrap_content”

android:text=“1、滑動(dòng)下面的滑桿后,上面的進(jìn)度條會(huì)同步\n 2、滑動(dòng)到最大值的時(shí)候,最上面的進(jìn)度條會(huì)消失” />

效果

Android快速入門-----用戶界面(上)UI組件(1),程序員,android,ui,linux

d、完成上述第一個(gè)功能ProgressActivity

Android快速入門-----用戶界面(上)UI組件(1),程序員,android,ui,linux

package com.itzheng.l03_compoment;

import android.app.Activity;

import android.os.Bundle;

import android.util.Log;

import android.view.Menu;

import android.view.MenuItem;

import android.widget.LinearLayout;

import android.widget.ProgressBar;

import android.widget.SeekBar;

import android.widget.SeekBar.OnSeekBarChangeListener;

/*

  • 測(cè)試進(jìn)度條

*/

public class ProgressActivity extends Activity {

private LinearLayout ll_progress_loading;

private ProgressBar pb_progress_loading;

private SeekBar sb_progress_loading;

private OnSeekBarChangeListener onSeekBarChangeListener = new OnSeekBarChangeListener() {

@Override

public void onStopTrackingTouch(SeekBar seekBar) {//離開(kāi)滑桿

Log.e(“TAG”, “離開(kāi)滑桿”);

//1. 得到seekBar的進(jìn)度

int progress = sb_progress_loading.getProgress();

//2. 設(shè)置為ProgressBar的進(jìn)度

pb_progress_loading.setProgress(progress);

}

@Override

public void onStartTrackingTouch(SeekBar seekBar) {//按下滑桿

Log.e(“TAG”, “按下滑桿”);

}

@Override

public void onProgressChanged(SeekBar seekBar, int progress,

boolean fromUser) {//滑桿移動(dòng)

Log.e(“TAG”, “滑桿移動(dòng)”);

}

};

@Override

protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_progress);

ll_progress_loading = (LinearLayout) findViewById(R.id.ll_progress_loading);

pb_progress_loading = (ProgressBar) findViewById(R.id.pb_progress_loading);

sb_progress_loading = (SeekBar) findViewById(R.id.sb_progress_loading);

//給seekbar設(shè)置監(jiān)聽(tīng)

sb_progress_loading.setOnSeekBarChangeListener(onSeekBarChangeListener );

}

}

Android快速入門-----用戶界面(上)UI組件(1),程序員,android,ui,linux

e、完善上述第二個(gè)功能:修改ProgressActivity

Android快速入門-----用戶界面(上)UI組件(1),程序員,android,ui,linux

//3、判斷是否達(dá)到最大值

if(progress == sb_progress_loading.getMax()){

//如果達(dá)到了,設(shè)置ll_progress_loading消失

//ll_progress_loading.setVisibility(View.INVISIBLE);不可見(jiàn)但是占用空間

ll_progress_loading.setVisibility(View.GONE);//不可見(jiàn)不占用空間

}else{

//如果沒(méi)有達(dá)到,設(shè)置ll_progress_loading顯示

ll_progress_loading.setVisibility(View.VISIBLE);

}

Android快速入門-----用戶界面(上)UI組件(1),程序員,android,ui,linux

(10)對(duì)話框Component

Android快速入門-----用戶界面(上)UI組件(1),程序員,android,ui,linux

1)測(cè)試界面

Android快速入門-----用戶界面(上)UI組件(1),程序員,android,ui,linux

2)代碼實(shí)現(xiàn)(AlertDialog)

Android快速入門-----用戶界面(上)UI組件(1),程序員,android,ui,linux

a、創(chuàng)建DialogActivity

Android快速入門-----用戶界面(上)UI組件(1),程序員,android,ui,linux

b、修改activity_dialog.xml

<LinearLayout xmlns:android=“http://schemas.android.com/apk/res/android”

android:layout_width=“fill_parent”

android:layout_height=“fill_parent”

android:orientation=“vertical” >

<Button

android:id=“@+id/btn_test4_ad”

android:layout_width=“match_parent”

android:layout_height=“wrap_content”

android:onClick=“showAD”

android:text=“顯示一般AlertDialog” />

<Button

android:id=“@+id/btn_test4_ld”

android:layout_width=“match_parent”

android:layout_height=“wrap_content”

android:onClick=“showLD”

android:text=“顯示單選列表AlertDialog” />

<Button

android:id=“@+id/btn_test4_custom”

android:layout_width=“match_parent”

android:layout_height=“wrap_content”

android:onClick=“showCD”

android:text=“顯示自定義AlertDialog” />

<Button

android:id=“@+id/btn_test4_pd”

android:layout_width=“match_parent”

android:layout_height=“wrap_content”

android:onClick=“showPD”

android:text=“顯示圓形進(jìn)度ProgressDialog”

android:layout_marginTop=“20dp”/>

<Button

android:id=“@+id/btn_test4_pd2”

android:layout_width=“match_parent”

android:layout_height=“wrap_content”

android:onClick=“showPD2”

android:text=“顯示水平進(jìn)度ProgressDialog” />

<Button

android:id=“@+id/btn_test4_dd”

android:layout_width=“match_parent”

android:layout_height=“wrap_content”

android:onClick=“showDateAD”

android:text=“顯示DatePickerDialog”

android:layout_marginTop=“20dp”/>

<Button

android:id=“@+id/btn_test4_td”

android:layout_width=“match_parent”

android:layout_height=“wrap_content”

android:onClick=“showTimeAD”

android:text=“顯示TimePickerDialog” />

c、修改DialogActivity

Android快速入門-----用戶界面(上)UI組件(1),程序員,android,ui,linux

package com.itzheng.l03_compoment;

import android.app.Activity;

import android.app.AlertDialog;

import android.content.DialogInterface;

import android.os.Bundle;

import android.view.Menu;

import android.view.MenuItem;

import android.view.View;

import android.widget.Toast;

public class DialogActivity extends Activity {

@Override

protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_dialog);

}

//顯示一般的AlertDialog

public void showAD(View v){

//new AlertDialog.Builder(this).create().show();

new AlertDialog.Builder(this)

.setTitle(“刪除數(shù)據(jù)”)//設(shè)置標(biāo)題

.setMessage(“你確定生刪除數(shù)據(jù)嗎”)

.setPositiveButton(“刪除”, new DialogInterface.OnClickListener() {

@Override

public void onClick(DialogInterface dialog, int which) {

Toast.makeText(DialogActivity.this, “刪除數(shù)據(jù)”, 0).show();

}

})

.setNegativeButton(“取消”, new DialogInterface.OnClickListener() {

@Override

public void onClick(DialogInterface dialog, int which) {

Toast.makeText(DialogActivity.this, “取消刪除數(shù)據(jù)”, 0).show();

}

})

.show();//方法鏈調(diào)用,每個(gè)方法都是返回的是當(dāng)前對(duì)象

}

}

d、測(cè)試

Android快速入門-----用戶界面(上)UI組件(1),程序員,android,ui,linux

Android快速入門-----用戶界面(上)UI組件(1),程序員,android,ui,linux

Android快速入門-----用戶界面(上)UI組件(1),程序員,android,ui,linux

e、實(shí)現(xiàn)單選功能:修改DialogActivity添加showLD方法

Android快速入門-----用戶界面(上)UI組件(1),程序員,android,ui,linux

/*

  • 顯示單選列表的AlertDialog

*/

public void showLD(View v){

final String [] items = {“紅”,“藍(lán)”,“綠”,“灰”};//final修飾的變量不會(huì)因?yàn)榉椒▓?zhí)行完畢而銷毀,在方法執(zhí)行完畢后還存在

new AlertDialog.Builder(this)

.setTitle(“指定背景顏色”)

.setSingleChoiceItems(items, 2, new DialogInterface.OnClickListener() {

@Override

public void onClick(DialogInterface dialog, int which) {//which就是選中的position

//提示顏色

Toast.makeText(DialogActivity.this, items[which], 0).show();

//移除dialog

dialog.dismiss();

}

} )

.show();

}

f、測(cè)試

Android快速入門-----用戶界面(上)UI組件(1),程序員,android,ui,linux

Android快速入門-----用戶界面(上)UI組件(1),程序員,android,ui,linux

3)自定義AlertDialog

Android快速入門-----用戶界面(上)UI組件(1),程序員,android,ui,linux

a、創(chuàng)建安卓XML

Android快速入門-----用戶界面(上)UI組件(1),程序員,android,ui,linux

Android快速入門-----用戶界面(上)UI組件(1),程序員,android,ui,linux

<?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” >

<ImageView

android:id=“@+id/imageView1”

android:layout_width=“fill_parent”

android:layout_height=“wrap_content”

android:src=“@drawable/title”

android:scaleType=“fitXY”

/>

<EditText

android:id=“@+id/et_dialog_name”

android:layout_width=“match_parent”

android:layout_height=“wrap_content”

android:hint=“用戶名”

/>

<EditText

android:id=“@+id/et_dialog_pwd”

android:layout_width=“match_parent”

android:layout_height=“wrap_content”

android:hint=“密碼”

android:inputType=“textPassword”

/>

Android快速入門-----用戶界面(上)UI組件(1),程序員,android,ui,linux

b、修改DialogActivity創(chuàng)建showCD方法

Android快速入門-----用戶界面(上)UI組件(1),程序員,android,ui,linux

/*

  • 顯示自定義的AlertDialog

*/

public void showCD(View v) {

// 動(dòng)態(tài)加載布局文件,得到對(duì)應(yīng)的View對(duì)象

View view = View.inflate(this, R.layout.dialog_view, null);

// 問(wèn)題1?view的真實(shí)類型?是布局文件根標(biāo)簽的類型,包含了子View對(duì)象

// 問(wèn)題2?如何得到一個(gè)獨(dú)立的View的子View?通過(guò)view.findViewById(id)

// findViewById(id)是在setContentView()中的View中找

final EditText nameET = (EditText) view

.findViewById(R.id.et_dialog_name);

final EditText pwdET = (EditText) view.findViewById(R.id.et_dialog_pwd);

new AlertDialog.Builder(this).setView(view)

.setNegativeButton(“取消”, null)

.setPositiveButton(“確定”, new DialogInterface.OnClickListener() {

@Override

public void onClick(DialogInterface dialog, int which) {

// 讀取用戶和密碼

String username = nameET.getText().toString();

String pwd = pwdET.getText().toString();

// 提示

Toast.makeText(DialogActivity.this,

username + " : " + pwd, 0).show();

}

}).show();

}

測(cè)試

Android快速入門-----用戶界面(上)UI組件(1),程序員,android,ui,linux

Android快速入門-----用戶界面(上)UI組件(1),程序員,android,ui,linux

Android快速入門-----用戶界面(上)UI組件(1),程序員,android,ui,linux

(11)ProgreeDialog:帶進(jìn)度條Dialog

Android快速入門-----用戶界面(上)UI組件(1),程序員,android,ui,linux

a、帶圓形的進(jìn)度條:修改DialogActivity,添加showPD方法

Android快速入門-----用戶界面(上)UI組件(1),程序員,android,ui,linux

/*

  • 顯示圓形進(jìn)度的ProgressDialog

*/

public void showPD(View v) {// 回調(diào)方法都是在主線程執(zhí)行的

final ProgressDialog dialog = ProgressDialog.show(this, “數(shù)據(jù)加載”, “數(shù)據(jù)加載中。。。”);

// 模擬一個(gè)長(zhǎng)時(shí)間的工作

// 長(zhǎng)時(shí)間的工作不能在主線程當(dāng)中做,得啟動(dòng)分線程去完成

new Thread() {

public void run() {// 分線程執(zhí)行

for (int i = 0; i < 20; i++) {

// 休息一會(huì)

try {

Thread.sleep(100);

} catch (InterruptedException e) {

// TODO Auto-generated catch block

e.printStackTrace();

}

}

// 移除dialog

dialog.dismiss();//方法是在分線程執(zhí)行的,但是內(nèi)部使用的Handler實(shí)現(xiàn)主線程移除dialog

// 不能在分線程之間更新UI

// 顯示toast

//Toast.makeText(DialogActivity.this, “加載完成!!!”, 0).show();

runOnUiThread(new Runnable() {

@Override

public void run() {

Toast.makeText(DialogActivity.this, “加載完成!!!”, 0).show();

}

});

};

}.start();

}

Android快速入門-----用戶界面(上)UI組件(1),程序員,android,ui,linux

Android快速入門-----用戶界面(上)UI組件(1),程序員,android,ui,linux

上面界面消失

b、水平的進(jìn)度條

Android快速入門-----用戶界面(上)UI組件(1),程序員,android,ui,linux

/*

  • 顯示水平進(jìn)度的ProgressDialog

*/

public void showPD2(View v) {

//1、創(chuàng)建dialog對(duì)象

final ProgressDialog pd = new ProgressDialog(this);

//2、設(shè)置樣式

pd.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);

//3、顯示

pd.show();

//4、啟動(dòng)分線程,加載數(shù)據(jù),并顯示進(jìn)度,當(dāng)加載完成移除dialog

new Thread(new Runnable() {

@Override

public void run() {

int count = 10;

//設(shè)置最大進(jìn)度

pd.setMax(count);

for (int i = 0; i < 20; i++) {

try {

Thread.sleep(100);

} catch (InterruptedException e) {

// TODO Auto-generated catch block

e.printStackTrace();

}

//加載進(jìn)度(在之前的進(jìn)度上加1)

pd.setProgress(pd.getProgress()+1);

}

//移除Dialog

pd.dismiss();

}

}).start();

// 不能在分線程之間更新UI

// 顯示toast

//Toast.makeText(DialogActivity.this, “加載完成!!!”, 0).show();

runOnUiThread(new Runnable() {

@Override

public void run() {//在主線執(zhí)行

Toast.makeText(DialogActivity.this, “加載完成!!!”, 0).show();

}

});

}

Android快速入門-----用戶界面(上)UI組件(1),程序員,android,ui,linux

Android快速入門-----用戶界面(上)UI組件(1),程序員,android,ui,linux

(12)DateDialog:日期Dialog

Android快速入門-----用戶界面(上)UI組件(1),程序員,android,ui,linux

修改DialogActivity創(chuàng)建showDateAD方法和showTimeAD方法

Android快速入門-----用戶界面(上)UI組件(1),程序員,android,ui,linux

Android快速入門-----用戶界面(上)UI組件(1),程序員,android,ui,linux

public void showDateAD(View v) {

// 創(chuàng)建日歷對(duì)象

Calendar calendar = Calendar.getInstance();

// 得到當(dāng)前得到年月日

int year = calendar.get(Calendar.YEAR);

int monthOfYear = calendar.get(Calendar.MONTH);

int dayOfMonth = calendar.get(Calendar.DAY_OF_MONTH);

Log.e(“TAG”, year + “-” + monthOfYear + “-” + dayOfMonth);

new DatePickerDialog(this, new OnDateSetListener() {

@Override

public void onDateSet(DatePicker view, int year, int monthOfYear,

int dayOfMonth) {

Log.e(“TAG”, year + “–” + (monthOfYear +1)+ “–” + dayOfMonth);

}

}, year, monthOfYear, dayOfMonth).show();;

}

//顯示時(shí)間

public void showTimeAD(View v) {

Calendar c = Calendar.getInstance();

int hourOfDay = c.get(Calendar.HOUR_OF_DAY);

int minute = c.get(Calendar.MINUTE);

自我介紹一下,小編13年上海交大畢業(yè),曾經(jīng)在小公司待過(guò),也去過(guò)華為、OPPO等大廠,18年進(jìn)入阿里一直到現(xiàn)在。

深知大多數(shù)初中級(jí)Android工程師,想要提升技能,往往是自己摸索成長(zhǎng)或者是報(bào)班學(xué)習(xí),但對(duì)于培訓(xùn)機(jī)構(gòu)動(dòng)則近萬(wàn)的學(xué)費(fèi),著實(shí)壓力不小。自己不成體系的自學(xué)效果低效又漫長(zhǎng),而且極易碰到天花板技術(shù)停滯不前!

因此收集整理了一份《2024年Android移動(dòng)開(kāi)發(fā)全套學(xué)習(xí)資料》,初衷也很簡(jiǎn)單,就是希望能夠幫助到想自學(xué)提升又不知道該從何學(xué)起的朋友,同時(shí)減輕大家的負(fù)擔(dān)。

Android快速入門-----用戶界面(上)UI組件(1),程序員,android,ui,linux

Android快速入門-----用戶界面(上)UI組件(1),程序員,android,ui,linux

Android快速入門-----用戶界面(上)UI組件(1),程序員,android,ui,linux

Android快速入門-----用戶界面(上)UI組件(1),程序員,android,ui,linux

Android快速入門-----用戶界面(上)UI組件(1),程序員,android,ui,linux

既有適合小白學(xué)習(xí)的零基礎(chǔ)資料,也有適合3年以上經(jīng)驗(yàn)的小伙伴深入學(xué)習(xí)提升的進(jìn)階課程,基本涵蓋了95%以上Android開(kāi)發(fā)知識(shí)點(diǎn),真正體系化!

由于文件比較大,這里只是將部分目錄截圖出來(lái),每個(gè)節(jié)點(diǎn)里面都包含大廠面經(jīng)、學(xué)習(xí)筆記、源碼講義、實(shí)戰(zhàn)項(xiàng)目、講解視頻,并且會(huì)持續(xù)更新!

如果你覺(jué)得這些內(nèi)容對(duì)你有幫助,可以掃碼獲取?。。▊渥ⅲ篈ndroid)

Android快速入門-----用戶界面(上)UI組件(1),程序員,android,ui,linux

總結(jié):

各行各樣都會(huì)淘汰一些能力差的,不僅僅是IT這個(gè)行業(yè),所以,不要被程序猿是吃青春飯等等這類話題所嚇倒,也不要覺(jué)得,找到一份工作,就享受安逸的生活,你在安逸的同時(shí),別人正在奮力的向前跑,這樣與別人的差距也就會(huì)越來(lái)越遙遠(yuǎn),加油,希望,我們每一個(gè)人,成為更好的自己。

  • BAT大廠面試題、獨(dú)家面試工具包,

  • 資料包括 數(shù)據(jù)結(jié)構(gòu)、Kotlin、計(jì)算機(jī)網(wǎng)絡(luò)、Framework源碼、數(shù)據(jù)結(jié)構(gòu)與算法、小程序、NDK、Flutter
    Android快速入門-----用戶界面(上)UI組件(1),程序員,android,ui,linux

《互聯(lián)網(wǎng)大廠面試真題解析、進(jìn)階開(kāi)發(fā)核心學(xué)習(xí)筆記、全套講解視頻、實(shí)戰(zhàn)項(xiàng)目源碼講義》點(diǎn)擊傳送門即可獲??!文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-854196.html

Dialog(this, new OnDateSetListener() {

@Override

public void onDateSet(DatePicker view, int year, int monthOfYear,

int dayOfMonth) {

Log.e(“TAG”, year + “–” + (monthOfYear +1)+ “–” + dayOfMonth);

}

}, year, monthOfYear, dayOfMonth).show();;

}

//顯示時(shí)間

public void showTimeAD(View v) {

Calendar c = Calendar.getInstance();

int hourOfDay = c.get(Calendar.HOUR_OF_DAY);

int minute = c.get(Calendar.MINUTE);

自我介紹一下,小編13年上海交大畢業(yè),曾經(jīng)在小公司待過(guò),也去過(guò)華為、OPPO等大廠,18年進(jìn)入阿里一直到現(xiàn)在。

深知大多數(shù)初中級(jí)Android工程師,想要提升技能,往往是自己摸索成長(zhǎng)或者是報(bào)班學(xué)習(xí),但對(duì)于培訓(xùn)機(jī)構(gòu)動(dòng)則近萬(wàn)的學(xué)費(fèi),著實(shí)壓力不小。自己不成體系的自學(xué)效果低效又漫長(zhǎng),而且極易碰到天花板技術(shù)停滯不前!

因此收集整理了一份《2024年Android移動(dòng)開(kāi)發(fā)全套學(xué)習(xí)資料》,初衷也很簡(jiǎn)單,就是希望能夠幫助到想自學(xué)提升又不知道該從何學(xué)起的朋友,同時(shí)減輕大家的負(fù)擔(dān)。

[外鏈圖片轉(zhuǎn)存中…(img-DAaWwTTr-1712563295624)]

[外鏈圖片轉(zhuǎn)存中…(img-qskejwQD-1712563295625)]

[外鏈圖片轉(zhuǎn)存中…(img-8PREuu18-1712563295625)]

[外鏈圖片轉(zhuǎn)存中…(img-yHiWE34z-1712563295625)]

[外鏈圖片轉(zhuǎn)存中…(img-LSDRnGf6-1712563295626)]

既有適合小白學(xué)習(xí)的零基礎(chǔ)資料,也有適合3年以上經(jīng)驗(yàn)的小伙伴深入學(xué)習(xí)提升的進(jìn)階課程,基本涵蓋了95%以上Android開(kāi)發(fā)知識(shí)點(diǎn),真正體系化!

由于文件比較大,這里只是將部分目錄截圖出來(lái),每個(gè)節(jié)點(diǎn)里面都包含大廠面經(jīng)、學(xué)習(xí)筆記、源碼講義、實(shí)戰(zhàn)項(xiàng)目、講解視頻,并且會(huì)持續(xù)更新!

如果你覺(jué)得這些內(nèi)容對(duì)你有幫助,可以掃碼獲?。。。▊渥ⅲ篈ndroid)

Android快速入門-----用戶界面(上)UI組件(1),程序員,android,ui,linux

總結(jié):

各行各樣都會(huì)淘汰一些能力差的,不僅僅是IT這個(gè)行業(yè),所以,不要被程序猿是吃青春飯等等這類話題所嚇倒,也不要覺(jué)得,找到一份工作,就享受安逸的生活,你在安逸的同時(shí),別人正在奮力的向前跑,這樣與別人的差距也就會(huì)越來(lái)越遙遠(yuǎn),加油,希望,我們每一個(gè)人,成為更好的自己。

  • BAT大廠面試題、獨(dú)家面試工具包,

  • 資料包括 數(shù)據(jù)結(jié)構(gòu)、Kotlin、計(jì)算機(jī)網(wǎng)絡(luò)、Framework源碼、數(shù)據(jù)結(jié)構(gòu)與算法、小程序、NDK、Flutter
    [外鏈圖片轉(zhuǎn)存中…(img-BHkIRCwl-1712563295626)]

《互聯(lián)網(wǎng)大廠面試真題解析、進(jìn)階開(kāi)發(fā)核心學(xué)習(xí)筆記、全套講解視頻、實(shí)戰(zhàn)項(xiàng)目源碼講義》點(diǎn)擊傳送門即可獲取!

到了這里,關(guān)于Android快速入門-----用戶界面(上)UI組件(1)的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來(lái)自互聯(lián)網(wǎng)用戶投稿,該文觀點(diǎn)僅代表作者本人,不代表本站立場(chǎng)。本站僅提供信息存儲(chǔ)空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請(qǐng)注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實(shí)不符,請(qǐng)點(diǎn)擊違法舉報(bào)進(jìn)行投訴反饋,一經(jīng)查實(shí),立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費(fèi)用

相關(guān)文章

  • Android布局和控件:創(chuàng)建用戶界面的XML布局文件和常用UI控件詳解

    在Android應(yīng)用開(kāi)發(fā)中,創(chuàng)建用戶界面是一個(gè)重要的任務(wù)。通過(guò)使用XML布局文件和常用的UI控件,開(kāi)發(fā)人員可以設(shè)計(jì)和構(gòu)建出吸引人且功能豐富的應(yīng)用界面。本文將詳細(xì)介紹如何使用XML布局文件來(lái)創(chuàng)建Android應(yīng)用的用戶界面,并深入探討一些常用UI控件的屬性和用法。 XML布局文件是

    2024年02月17日
    瀏覽(30)
  • [QT編程系列-3]:C++圖形用戶界面編程,QT框架快速入門培訓(xùn) - 2- QT程序的運(yùn)行框架:HelloWorld、常見(jiàn)控件、對(duì)象樹(shù)原理

    [QT編程系列-3]:C++圖形用戶界面編程,QT框架快速入門培訓(xùn) - 2- QT程序的運(yùn)行框架:HelloWorld、常見(jiàn)控件、對(duì)象樹(shù)原理

    目錄 2.?QT程序的運(yùn)行框架 2.1 Hello World程序框架 2.2 QT Designer初識(shí) 2.3 用QT Designer設(shè)計(jì)用戶登錄界 上述示例代碼中,首先根據(jù)應(yīng)用程序的需求使用 QCoreApplication 或 QApplication 定義 app 對(duì)象。如果你的應(yīng)用程序需要圖形界面,則使用 QApplication,否則使用 QCoreApplication。然后,你可以

    2024年02月15日
    瀏覽(23)
  • [QT編程系列-7]:C++圖形用戶界面編程,QT框架快速入門培訓(xùn) - 3- QT窗體設(shè)計(jì) - 自定義工具欄、狀態(tài)欄、快捷鍵、圖標(biāo)

    [QT編程系列-7]:C++圖形用戶界面編程,QT框架快速入門培訓(xùn) - 3- QT窗體設(shè)計(jì) - 自定義工具欄、狀態(tài)欄、快捷鍵、圖標(biāo)

    目錄 3.?QT窗體設(shè)計(jì) 3.2?自定義工具欄 3.2.1 目標(biāo) 3.2.2 實(shí)現(xiàn)過(guò)程 3.2?自定義狀態(tài)欄 3.2.1??目標(biāo) 3.2.2? 過(guò)程 3.3?自定義動(dòng)作快捷鍵 3.4?自定義圖標(biāo) 在Qt中,ToolBar(工具欄)是一種常見(jiàn)的GUI元素,用于提供應(yīng)用程序的常用工具按鈕和操作。工具欄通常包含一系列圖標(biāo)按鈕,用于執(zhí)

    2024年02月15日
    瀏覽(30)
  • 快速上手Opencv:HighGUI圖形用戶界面

    快速上手Opencv:HighGUI圖形用戶界面

    1.1 圖像的載入:imread()函數(shù) Mat imread(const string filename,int flags=1) 第一個(gè)參數(shù):圖片路徑 第二個(gè)參數(shù):載入標(biāo)識(shí),指定一個(gè)加載圖像的顏色類型。可以看到它自帶的默認(rèn)值為1 1.2 圖像的顯示:imshow()函數(shù) void imshow(const string winname InputArray mat) 第一個(gè)參數(shù):填需要顯示的窗口標(biāo)識(shí)名

    2024年02月08日
    瀏覽(21)
  • 燕山大學(xué)——軟件用戶界面設(shè)計(jì)(五)UI架構(gòu)

    燕山大學(xué)——軟件用戶界面設(shè)計(jì)(五)UI架構(gòu)

    ? ? ? ? ? ? ?界面設(shè)計(jì)中的“設(shè)計(jì)”與“實(shí)現(xiàn)”,本節(jié)的UI架構(gòu)屬于“實(shí)現(xiàn)”部分。 (1)視圖樹(shù)( View tree ) ①定義:GUI結(jié)構(gòu)是一個(gè)視圖樹(shù)。視圖是一個(gè)對(duì)象,顯示在屏幕的某個(gè)區(qū)域,可以是一個(gè)控件或者其他元素。 ②視圖樹(shù)的使用: ????????輸出:GUI通過(guò)改變視圖樹(shù)

    2024年02月05日
    瀏覽(18)
  • 高性能JavaScript——6、快速響應(yīng)的用戶界面

    高性能JavaScript——6、快速響應(yīng)的用戶界面

    大多數(shù)瀏覽器讓一個(gè)單線程共用于執(zhí)行JavaScript和更新用戶界面。每個(gè)時(shí)刻只能執(zhí)行其中一種操作,這意味著當(dāng)JavaScript代碼正在執(zhí)行時(shí)用戶界面無(wú)法響應(yīng)輸入,反之亦然。當(dāng)JavaScript代碼執(zhí)行時(shí),用戶界面處于“鎖定”狀態(tài)。管理好JavaScript的運(yùn)行時(shí)間對(duì)Web應(yīng)用的性能非常重要。

    2024年04月17日
    瀏覽(16)
  • Android 實(shí)現(xiàn)用戶登陸界面

    Android 實(shí)現(xiàn)用戶登陸界面

    Button是TextView的一個(gè)子類,EditView同樣也是TextView的子類 其中,EditView是一個(gè)可輸入內(nèi)容的組件 參考屬性文檔 :包含EditText控件的常用屬性 常用基本屬性介紹: 屬性 含義 textAllCaps 設(shè)置字體大小寫(xiě),android:textAllCaps=\\\"false\\\"表示字體顯示和輸入的內(nèi)容一致 hint 設(shè)置文本框初始顯示

    2024年02月07日
    瀏覽(27)
  • 【pycharm】【自定義UI】【User Interface】(用戶界面)

    目錄 Customizing the UI? 自定義UI(用戶界面) 1 How to configure your UI exactly as you want it. 1 如何配置你的UI完全按照你想要的。 2 Themes 2?主題 3 Layout 3 布局 4 Keymap? 4 鍵映射 5 Other Customizations? 5 其他定制 6 Conclusion 6 結(jié)論 1 How to configure your UI exactly as you want it.

    2024年02月21日
    瀏覽(29)
  • 前端組件開(kāi)發(fā)指南:構(gòu)建可復(fù)用、高效的用戶界面

    在現(xiàn)代Web開(kāi)發(fā)中,前端組件扮演著重要的角色。它們是構(gòu)建用戶界面的基本構(gòu)建塊,能夠使開(kāi)發(fā)人員更高效地開(kāi)發(fā)、測(cè)試和維護(hù)代碼。本文將帶您深入了解前端組件的概念、優(yōu)勢(shì)以及如何使用常見(jiàn)的前端框架構(gòu)建可復(fù)用的組件。 前端組件是一種封裝了HTML、CSS和JavaScript代碼的

    2024年02月16日
    瀏覽(42)
  • 從 AI 的爆火聊聊用戶界面(UI)的演進(jìn)

    目錄 用戶界面的起源與發(fā)展 用戶界面的設(shè)計(jì)原則與趨勢(shì) 用戶界面未來(lái)的方向 小結(jié) 用戶界面(User Interface,簡(jiǎn)稱 UI)是人與計(jì)算機(jī)系統(tǒng)交互的媒介,用戶可以通過(guò)用戶界面向計(jì)算機(jī)發(fā)送指令,同時(shí)計(jì)算機(jī)可以通過(guò)用戶界面向用戶展示信息。用戶界面的設(shè)計(jì)和演進(jìn)不僅反映了技

    2024年03月18日
    瀏覽(15)

覺(jué)得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請(qǐng)作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包