国产成人精品久久免费动漫-国产成人精品天堂-国产成人精品区在线观看-国产成人精品日本-a级毛片无码免费真人-a级毛片毛片免费观看久潮喷

您的位置:首頁(yè)技術(shù)文章
文章詳情頁(yè)

Android小程序?qū)崿F(xiàn)簡(jiǎn)易QQ界面

瀏覽:84日期:2022-06-07 08:40:08

本文實(shí)例為大家分享了Android實(shí)現(xiàn)簡(jiǎn)易QQ界面的具體代碼,供大家參考,具體內(nèi)容如下

要求:

(1)與QQ界面控件數(shù)目、樣式相同 (2)與QQ的圖形化界面相同 (3)實(shí)現(xiàn)一個(gè)簡(jiǎn)單的點(diǎn)擊事件

具體實(shí)現(xiàn):

(1)編寫程序代碼

package com.example.login;import android.app.Activity;import android.os.Bundle;import android.util.Log;import android.view.Menu;import android.view.MenuItem;import android.view.View;import android.view.View.OnClickListener;import android.view.Window;import android.widget.Button;import android.widget.EditText;import android.widget.RadioButton;import android.widget.Toast;import android.widget.ToggleButton;public class MainActivity extends Activity { //聲明組件 private EditText username; private EditText password; private Button login; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); //無(wú)標(biāo)題設(shè)置 requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.activity_main); //初始化控件,根據(jù)Id獲取組件對(duì)象 username = (EditText)findViewById(R.id.username); password = (EditText)findViewById(R.id.password); login = (Button)findViewById(R.id.login); //注冊(cè)監(jiān)聽(tīng) login.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { // 登錄 Log.i('tag', 'username:'+username.getText().toString()); Log.i('tag', 'password:'+password.getText().toString()); Toast t1 = Toast.makeText(getApplicationContext(), '登錄成功', Toast.LENGTH_LONG); t1.show(); } }); }}

(2)對(duì)應(yīng)布局文件

<LinearLayout xmlns:android='http://schemas.android.com/apk/res/android' android:layout_width='match_parent' android:layout_height='match_parent' android:background='@drawable/aa' android:orientation='vertical' > <LinearLayout android:layout_width='match_parent' android:layout_height='match_parent' android:background='#55000000' android:orientation='vertical' android:paddingLeft='30dp' android:paddingRight='30dp' > <LinearLayout android:layout_marginTop='80dp' android:layout_width='match_parent' android:layout_height='wrap_content' android:gravity='center_vertical' android:orientation='horizontal' > <ImageView android:layout_width='43dp' android:layout_height='43dp' android:src='http://www.cgvv.com.cn/bcjs/@drawable/qq' /> <TextView android:layout_width='wrap_content' android:layout_height='wrap_content' android:text='QQ' android:textColor='#fff' android:textSize='50dp' /> </LinearLayout> <EditText android: android:layout_width='match_parent' android:layout_height='wrap_content' android:layout_marginTop='30dp' android:background='@null' android:hint='QQ號(hào)/手機(jī)號(hào)/郵箱' android:maxLength='13' android:singleLine='true' android:textColor='#fff' android:textSize='30px' android:textColorHint='#eee' /> <View android:layout_width='match_parent' android:layout_height='1px' android:layout_marginTop='10dp' android:background='#eee' /> <EditText android: android:layout_width='match_parent' android:layout_height='wrap_content' android:layout_marginTop='10dp' android:background='@null' android:hint='密碼' android:inputType='textPassword' android:maxLength='13' android:singleLine='true' android:textColor='#fff' android:textSize='30px' android:textColorHint='#eee' /> <View android:layout_width='match_parent' android:layout_height='1px' android:layout_marginTop='10dp' android:background='#eee' /> <Button android: android:layout_width='match_parent' android:layout_height='wrap_content' android:layout_marginTop='10dp' android:background='@drawable/button_login_bg' android:text='登錄' android:textColor='#fff' android:textSize='25px' /> <LinearLayout android:layout_width='match_parent' android:layout_height='wrap_content' android:layout_marginTop='10dp' android:orientation='horizontal' > <TextView android:layout_width='wrap_content' android:layout_height='wrap_content' android:layout_weight='1' android:text='忘記密碼?' android:textColor='#cc1CA4DE' android:textSize='20dp' /> <TextView android:layout_width='wrap_content' android:layout_height='wrap_content' android:layout_weight='1' android:gravity='right' android:text='新用戶注冊(cè)' android:textColor='#cc1CA4DE' android:textSize='20dp' /> </LinearLayout> </LinearLayout></LinearLayout>

(3)效果如下:

Android小程序?qū)崿F(xiàn)簡(jiǎn)易QQ界面

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

標(biāo)簽: qq
相關(guān)文章:
主站蜘蛛池模板: 久久国产精品永久免费网站 | 日韩欧美国产视频 | 久久国内精品自在自线软件 | 波多野结衣在线观看一区 | 亚洲视频三区 | 日本亚洲欧美高清专区vr专区 | 九九精品在线观看 | 欧美日韩一区二区三区在线视频 | 欧美三级欧美一级 | 午夜在线视频一区二区三区 | 亚洲综合爱久久影院 | 手机在线免费毛片 | 国产成人一区二区 | 欧美精品日日鲁夜夜添 | 99国产精品视频久久久久 | 国产在线91精品 | 亚洲欧美一级久久精品 | 美女双腿打开让男人桶爽网站 | 国产午夜a理论毛片在线影院 | 男吃女下面刺激视频免费 | 日本高清aⅴ毛片免费 | 久色乳综合思思在线视频 | 欧美综合一区 | 高清国产美女一级a毛片 | 国产伦精一区二区三区视频 | 男人天堂国产 | 亚洲成人在线视频 | 久久巨乳 | 国产午夜伦伦伦午夜伦 | 日韩一级大毛片欧美一级 | 91精品啪在线观看国产91九色 | 亚洲国产成人精品91久久久 | 亚洲欧美国产精品久久久 | 国产成人综合欧美精品久久 | 成人观看的视频三级 | 成人久久网站 | 国产一区二区福利久久 | 久久精品一区二区三区中文字幕 | 欧美日韩久久 | 色天天躁夜夜躁天干天干 | 国产在线精品一区二区 |