亚洲精品久久久中文字幕-亚洲精品久久片久久-亚洲精品久久青草-亚洲精品久久婷婷爱久久婷婷-亚洲精品久久午夜香蕉

您的位置:首頁技術文章
文章詳情頁

Android小程序實現簡易QQ界面

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

本文實例為大家分享了Android實現簡易QQ界面的具體代碼,供大家參考,具體內容如下

要求:

(1)與QQ界面控件數目、樣式相同 (2)與QQ的圖形化界面相同 (3)實現一個簡單的點擊事件

具體實現:

(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); //無標題設置 requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.activity_main); //初始化控件,根據Id獲取組件對象 username = (EditText)findViewById(R.id.username); password = (EditText)findViewById(R.id.password); login = (Button)findViewById(R.id.login); //注冊監聽 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)對應布局文件

<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.aoyou183.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號/手機號/郵箱' 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='新用戶注冊' android:textColor='#cc1CA4DE' android:textSize='20dp' /> </LinearLayout> </LinearLayout></LinearLayout>

(3)效果如下:

Android小程序實現簡易QQ界面

以上就是本文的全部內容,希望對大家的學習有所幫助,也希望大家多多支持好吧啦網。

標簽: qq
相關文章:
主站蜘蛛池模板: 亚洲欧洲日韩另类自拍 | 久久黄网 | 国产成人系列 | 欧美黄色大片免费看 | 亚洲高清在线观看 | 久久在线免费 | 黄色美女一级片 | 免费在线看黄视频 | 99草视频| 欧美a级片在线观看 | 韩国日本一级毛片免费视频 | 91福利在线免费观看 | 拍拍视频免费观看网站在线观看 | 亚洲成a人片在线观看中 | 伊人丁香婷婷综合一区二区 | 国产三级精品三级 | 亚洲一区欧美一区 | 91精品国产综合久久福利 | 欧美a一级 | 91热视频在线观看 | 一级做a爰片久久毛片免费看 | 国产在线麻豆精品 | 精品三级国产精品经典三 | 视频一区二区免费 | 国产大学生露脸激情 | 国产成人在线视频免费观看 | 国产日韩视频在线观看 | 国产 另类 在线 欧美日韩 | 麻豆国产精品va在线观看不卡 | 久久www成人看片 | 亚洲精品乱码电影在线观看 | 亚洲综合91| 成人性开放大片 | 麻豆国产91 | 亚洲无吗 | 国产手机在线小视频免费观看 | 亚洲精品久久久久久婷婷 | 亚洲精品久久久久久久网站 | 搞黄视频在线观看 | 国产一区二区三区不卡在线观看 | 日韩在线1 |