当前位置: 首页 > news >正文

23.实战演练--个人主页

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"xmlns:tools="http://schemas.android.com/tools"><applicationandroid:allowBackup="true"android:dataExtractionRules="@xml/data_extraction_rules"android:fullBackupContent="@xml/backup_rules"android:icon="@mipmap/ic_launcher"android:label="@string/app_name"android:roundIcon="@mipmap/ic_launcher_round"android:supportsRtl="true"android:theme="@style/Theme.LoginTest"tools:targetApi="31"><activityandroid:name=".EditProfileActivity"android:exported="false" /><activityandroid:name=".UserProfileActivity"android:exported="false" /><activityandroid:name=".LoginActivity"android:exported="true"android:label="登录"><intent-filter><action android:name="android.intent.action.MAIN" /><category android:name="android.intent.category.LAUNCHER" /></intent-filter></activity><activityandroid:name=".RegisterActivity"android:exported="false"android:label="注册" /><activityandroid:name=".MainActivity"android:exported="false"android:label="首页" /></application></manifest>

<?xml version="1.0" encoding="utf-8"?>
<resources><style name="MyBtnStyle"><item name="android:textColor">@color/white</item><item name="android:textSize">25sp</item><item name="android:background">@drawable/btn_bg_selector</item><item name="android:layout_marginTop">20dp</item><item name="android:layout_marginRight">20dp</item><item name="android:layout_marginLeft">20dp</item></style><style name="MyEditStyle"><item name="android:textSize">18sp</item><item name="android:background">@drawable/edit_text_bg</item><item name="android:paddingLeft">10dp</item><item name="android:layout_height">50dp</item></style>
</resources>

<resources><string name="app_name">LoginTest</string><string-array name="cities"><item>北京</item><item>上海</item><item>天津</item><item>深圳</item><item>广州</item><item>福建</item><item>江苏</item><item>浙江</item><item>江西</item><item>湖北</item></string-array>
</resources>

<?xml version="1.0" encoding="utf-8"?>
<resources><color name="black">#FF000000</color><color name="white">#FFFFFFFF</color><color name="green_200">#C5E1A5</color><color name="green_500">#8BC34A</color><color name="green_700">#689F38</color><color name="colorPrimary">@color/green_500</color><color name="colorPrimaryDark">@color/green_700</color><color name="accent">#F4511E</color><color name="teal_200">#FF03DAC5</color><color name="teal_700">#FF018786</color>
</resources>

<vector android:autoMirrored="true" android:height="24dp"android:tint="#093243" android:viewportHeight="24"android:viewportWidth="24" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android"><path android:fillColor="@android:color/white" android:pathData="M6.23,20.23l1.77,1.77l10,-10l-10,-10l-1.77,1.77l8.23,8.23z"/>
</vector>

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android"><item android:state_pressed="true" android:drawable="@color/colorPrimary"/><item android:state_pressed="false" android:drawable="@color/colorPrimaryDark"/>
</selector>

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"android:shape="rectangle"><stroke android:width="3dp" android:color="@color/colorPrimary"/><corners android:radius="10dp"/>
</shape>

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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:layout_height="match_parent"tools:context=".MainActivity"android:orientation="vertical"><TextViewandroid:id="@+id/tv_content"android:layout_width="wrap_content"android:layout_height="wrap_content"android:textSize="40sp"android:layout_marginTop="30dp"android:text="欢迎你:"android:layout_gravity="center_horizontal"/><Buttonandroid:id="@+id/btn_logout"android:layout_width="match_parent"android:layout_height="wrap_content"android:text="退出登录"android:textSize="25sp"android:layout_margin="20dp"android:background="@drawable/btn_bg_selector"/>
</LinearLayout>

package com.example.logintest;import androidx.appcompat.app.AppCompatActivity;import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;public class MainActivity extends AppCompatActivity implements View.OnClickListener {private Button btn_logout;private TextView tvContent;@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_main);btn_logout = findViewById(R.id.btn_logout);btn_logout.setOnClickListener(this);tvContent = findViewById(R.id.tv_content);Intent intent = getIntent();String account = intent.getStringExtra("account");tvContent.setText("欢迎你:"+account);}@Overridepublic void onClick(View view) {if (view.getId() == R.id.btn_logout) {SharedPreferences spf = getSharedPreferences("spfRecord",MODE_PRIVATE);SharedPreferences.Editor edit = spf.edit();edit.putBoolean("isLogin",false);edit.apply();Intent intent = new Intent(this, LoginActivity.class);startActivity(intent);this.finish();}}
}

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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:layout_height="match_parent"tools:context=".RegisterActivity"android:orientation="vertical"><LinearLayoutandroid:layout_width="match_parent"android:layout_height="wrap_content"android:orientation="horizontal"android:layout_marginLeft="20dp"android:layout_marginRight="20dp"android:layout_marginTop="40dp"android:gravity="center_vertical"><TextViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:text="账        号:"android:textSize="25sp"/><EditTextandroid:id="@+id/et_account"android:layout_width="match_parent"android:layout_height="50dp"android:hint="请输入用户名或手机号"android:textSize="18sp"android:layout_marginLeft="10dp"android:paddingLeft="5dp"android:inputType="text"android:background="@drawable/edit_text_bg"/></LinearLayout><LinearLayoutandroid:layout_width="match_parent"android:layout_height="wrap_content"android:orientation="horizontal"android:layout_marginLeft="20dp"android:layout_marginRight="20dp"android:layout_marginTop="40dp"android:gravity="center_vertical"><TextViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:text="密        码:"android:textSize="25sp"/><EditTextandroid:id="@+id/et_password"android:layout_width="match_parent"android:layout_height="50dp"android:hint="请输入密码"android:textSize="18sp"android:layout_marginLeft="10dp"android:paddingLeft="5dp"android:inputType="numberPassword"android:background="@drawable/edit_text_bg"/></LinearLayout><LinearLayoutandroid:layout_width="match_parent"android:layout_height="wrap_content"android:orientation="horizontal"android:layout_marginLeft="20dp"android:layout_marginRight="20dp"android:layout_marginTop="40dp"android:gravity="center_vertical"><TextViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:text="确认密码:"android:textSize="25sp"/><EditTextandroid:id="@+id/et_password_confirm"android:layout_width="match_parent"android:layout_height="50dp"android:hint="再次输入密码"android:textSize="18sp"android:layout_marginLeft="10dp"android:paddingLeft="5dp"android:inputType="numberPassword"android:background="@drawable/edit_text_bg"/></LinearLayout><Buttonandroid:id="@+id/btn_register"android:layout_width="match_parent"android:layout_height="wrap_content"android:text="注册"android:textSize="25sp"android:background="@drawable/btn_bg_selector"android:layout_marginTop="20dp"android:layout_marginLeft="20dp"android:layout_marginRight="20dp"/><CheckBoxandroid:id="@+id/rb_agree"android:layout_width="wrap_content"android:layout_height="wrap_content"android:textColor="@color/colorPrimary"android:text="同意用户协议?"android:layout_gravity="left"android:layout_marginLeft="20dp"android:layout_marginTop="10dp"/>
</LinearLayout>

package com.example.logintest;import androidx.appcompat.app.AppCompatActivity;import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.RadioButton;
import android.widget.Toast;public class RegisterActivity extends AppCompatActivity implements View.OnClickListener {private Button btnRegister;private EditText etAccount,etPass,etPassConfirm;private CheckBox rbAgree;@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_register);btnRegister = findViewById(R.id.btn_register);btnRegister.setOnClickListener(this);etAccount = findViewById(R.id.et_account);etAccount.setOnClickListener(this);etPass = findViewById(R.id.et_password);etPass.setOnClickListener(this);etPassConfirm = findViewById(R.id.et_password_confirm);etPassConfirm.setOnClickListener(this);rbAgree = findViewById(R.id.rb_agree);rbAgree.setOnClickListener(this);}@Overridepublic void onClick(View view) {String name = etAccount.getText().toString();String pass = etPass.getText().toString();String passConfirm = etPassConfirm.getText().toString();if (view.getId() == R.id.btn_register) {if (TextUtils.isEmpty(name)) {Toast.makeText(RegisterActivity.this, "用户名不能为空", Toast.LENGTH_LONG).show();return;}if (TextUtils.isEmpty(pass)) {Toast.makeText(RegisterActivity.this, "密码不能为空", Toast.LENGTH_LONG).show();return;}if (!TextUtils.equals(pass, passConfirm)) {Toast.makeText(RegisterActivity.this, "密码不一致", Toast.LENGTH_LONG).show();return;}if (!rbAgree.isChecked()) {Toast.makeText(RegisterActivity.this, "请同意用户协议", Toast.LENGTH_LONG).show();return;}SharedPreferences spf = getSharedPreferences("spfRecorid",MODE_PRIVATE);SharedPreferences.Editor edit = spf.edit();edit.putString("account",name);edit.putString("password",pass);Intent intent = new Intent();Bundle bundle = new Bundle();bundle.putString("account",name);bundle.putString("password",pass);intent.putExtras(bundle);setResult(0,intent);Toast.makeText(RegisterActivity.this, "注册成功", Toast.LENGTH_LONG).show();this.finish();}}
}

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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:layout_height="match_parent"tools:context=".LoginActivity"android:orientation="vertical"><LinearLayoutandroid:layout_width="match_parent"android:layout_height="wrap_content"android:orientation="horizontal"android:layout_marginLeft="20dp"android:layout_marginRight="20dp"android:layout_marginTop="40dp"android:gravity="center_vertical"><TextViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:text="账号:"android:textSize="25sp"/><EditTextandroid:id="@+id/et_account"android:layout_width="match_parent"android:layout_height="50dp"android:hint="请输入用户名或手机号"android:textSize="18sp"android:layout_marginLeft="10dp"android:paddingLeft="5dp"android:inputType="text"android:background="@drawable/edit_text_bg"/></LinearLayout><LinearLayoutandroid:layout_width="match_parent"android:layout_height="wrap_content"android:orientation="horizontal"android:layout_marginLeft="20dp"android:layout_marginRight="20dp"android:layout_marginTop="40dp"android:gravity="center_vertical"><TextViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:text="密码:"android:textSize="25sp"/><EditTextandroid:id="@+id/et_password"android:layout_width="match_parent"android:layout_height="50dp"android:hint="请输入密码"android:textSize="18sp"android:layout_marginLeft="10dp"android:paddingLeft="5dp"android:inputType="numberPassword"android:background="@drawable/edit_text_bg"/></LinearLayout><LinearLayoutandroid:layout_width="match_parent"android:layout_height="wrap_content"android:orientation="horizontal"android:gravity="center"android:layout_marginTop="20dp"android:layout_marginLeft="20dp"android:layout_marginRight="20dp"><CheckBoxandroid:id="@+id/cb_remember"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="记住密码"/><CheckBoxandroid:id="@+id/cb_auto_login"android:visibility="visible"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="自动登录"android:layout_marginLeft="40dp"/></LinearLayout><Buttonandroid:id="@+id/btn_Login"android:layout_width="match_parent"android:layout_height="wrap_content"android:text="登录"style="@style/MyBtnStyle"android:layout_marginTop="20dp"android:layout_marginLeft="20dp"android:layout_marginRight="20dp"/><TextViewandroid:id="@+id/to_register"android:layout_width="wrap_content"android:layout_height="wrap_content"android:textColor="@color/colorPrimary"android:text="还没有账号?"android:layout_gravity="right"android:layout_marginRight="20dp"android:layout_marginTop="10dp"/></LinearLayout>

package com.example.logintest;import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;public class LoginActivity extends AppCompatActivity implements View.OnClickListener, CompoundButton.OnCheckedChangeListener {public static final int REQUEST_CODE_REGISTER = 1;private Button btnLogin;private EditText etAccount,etPassword;private CheckBox cbRemember,cbAutoLogin;private TextView toRegister;private String userName = "admin";private String pass = "1234";@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_login);initView();initData();}@Overridepublic void onClick(View view) {if (view.getId() == R.id.btn_Login) {String account = etAccount.getText().toString();String passWord = etPassword.getText().toString();if (TextUtils.isEmpty(userName)){Toast.makeText(LoginActivity.this, "对不起,你还没注册账号!", Toast.LENGTH_LONG).show();return;}if (TextUtils.equals(account, userName)) {if (TextUtils.equals(passWord, pass)) {Toast.makeText(LoginActivity.this, "恭喜你,登陆成功!", Toast.LENGTH_LONG).show();if (cbRemember.isChecked()){SharedPreferences spf = getSharedPreferences("spfRecord",MODE_PRIVATE);SharedPreferences.Editor edit = spf.edit();edit.putString("account",account);edit.putString("password",passWord);edit.putBoolean("isRemember",true);if (cbAutoLogin.isChecked()){edit.putBoolean("isLogin",true);}else {edit.putBoolean("isLogin",false);}edit.apply();}else {SharedPreferences spf = getSharedPreferences("spfRecord",MODE_PRIVATE);SharedPreferences.Editor edit = spf.edit();edit.putBoolean("isRemember",false);edit.apply();}Intent intent = new Intent(LoginActivity.this, UserProfileActivity.class);intent.putExtra("account",account);startActivity(intent);LoginActivity.this.finish();} else {Toast.makeText(LoginActivity.this, "密码错误!", Toast.LENGTH_LONG).show();}} else {Toast.makeText(LoginActivity.this, "用户名错误!", Toast.LENGTH_LONG).show();}} else if (view.getId() == R.id.to_register) {Intent intent = new Intent(this, RegisterActivity.class);startActivityForResult(intent, REQUEST_CODE_REGISTER);}}@Overrideprotected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {super.onActivityResult(requestCode, resultCode, data);if (requestCode == REQUEST_CODE_REGISTER && resultCode == 0 && data!=null){Bundle extras = data.getExtras();String account = extras.getString("account", "");String password = extras.getString("password", "");etAccount.setText(account);etPassword.setText(password);userName = account;pass = password;}}private void initView(){btnLogin = findViewById(R.id.btn_Login);btnLogin.setOnClickListener(this);etAccount = findViewById(R.id.et_account);etAccount.setOnClickListener(this);etPassword = findViewById(R.id.et_password);etPassword.setOnClickListener(this);cbRemember = findViewById(R.id.cb_remember);cbRemember.setOnCheckedChangeListener(this::onCheckedChangedResult);cbAutoLogin = findViewById(R.id.cb_auto_login);cbAutoLogin.setOnCheckedChangeListener(this::onCheckedChanged);toRegister = findViewById(R.id.to_register);toRegister.setOnClickListener(this);}private void initData() {SharedPreferences spf = getSharedPreferences("spfRecord",MODE_PRIVATE);boolean isRemember = spf.getBoolean("isRemember",false);boolean isLogin = spf.getBoolean("isLogin",false);String account = spf.getString("account","");String password = spf.getString("password","");if (isLogin){Intent intent = new Intent(LoginActivity.this, UserProfileActivity.class);intent.putExtra("account",account);startActivity(intent);LoginActivity.this.finish();}userName = account;pass = password;if (isRemember){etAccount.setText(account);etPassword.setText(password);cbRemember.setChecked(true);}}@Overridepublic void onCheckedChanged(CompoundButton compoundButton, boolean b) {if (b){cbRemember.setChecked(true);}}public void onCheckedChangedResult(CompoundButton compoundButton, boolean b) {if (!b){cbAutoLogin.setChecked(false);}}
}

<?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:layout_height="match_parent"android:orientation="vertical"tools:context=".UserProfileActivity"><LinearLayoutandroid:layout_width="match_parent"android:layout_height="match_parent"android:orientation="vertical"><RelativeLayoutandroid:layout_width="match_parent"android:layout_height="250dp"android:background="@color/colorPrimary"><ImageViewandroid:id="@+id/iv_avatar"android:layout_width="100dp"android:layout_height="100dp"android:layout_centerInParent="true"android:src="@mipmap/ic_launcher" /><TextViewandroid:id="@+id/tv_nick_name"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_below="@id/iv_avatar"android:layout_centerHorizontal="true"android:layout_marginTop="5dp"android:text="admin"android:textColor="@color/white"android:textSize="14sp" /><LinearLayoutandroid:layout_width="match_parent"android:layout_height="wrap_content"android:layout_below="@id/tv_nick_name"android:gravity="center"android:orientation="horizontal"><TextViewandroid:id="@+id/tv_gender"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_below="@id/iv_avatar"android:layout_centerHorizontal="true"android:layout_marginTop="5dp"android:text="男"android:textColor="@color/white"android:textSize="14sp" /><TextViewandroid:id="@+id/tv_age"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_below="@id/iv_avatar"android:layout_centerHorizontal="true"android:layout_marginLeft="5dp"android:layout_marginTop="5dp"android:text="21岁"android:textColor="@color/white"android:textSize="14sp" /><TextViewandroid:id="@+id/tv_city"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_below="@id/iv_avatar"android:layout_centerHorizontal="true"android:layout_marginLeft="5dp"android:layout_marginTop="5dp"android:text="北京"android:textColor="@color/white"android:textSize="14sp" /></LinearLayout></RelativeLayout><RelativeLayoutandroid:layout_width="match_parent"android:layout_height="40dp"android:layout_marginTop="10dp"android:gravity="center_vertical"android:paddingLeft="10dp"><TextViewandroid:id="@+id/tv_account"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="账号"android:textSize="20sp" /><TextViewandroid:id="@+id/tv_account_text"android:layout_width="match_parent"android:layout_height="wrap_content"android:layout_alignBaseline="@+id/tv_account"android:layout_toRightOf="@id/tv_account"android:gravity="center"android:text="admin"android:textSize="20sp" /></RelativeLayout><RelativeLayoutandroid:layout_width="match_parent"android:layout_height="40dp"android:layout_marginTop="10dp"android:gravity="center_vertical"android:paddingLeft="10dp"><TextViewandroid:id="@+id/tv_birth_time"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="出生时间"android:textSize="20sp" /><TextViewandroid:id="@+id/tv_birth_time_text"android:layout_width="match_parent"android:layout_height="wrap_content"android:layout_alignBaseline="@id/tv_birth_time"android:layout_toRightOf="@id/tv_birth_time"android:gravity="center"android:text="123234"android:textSize="20sp" /></RelativeLayout><RelativeLayoutandroid:layout_width="match_parent"android:layout_height="40dp"android:layout_marginTop="10dp"android:gravity="center_vertical"android:paddingLeft="10dp"><TextViewandroid:id="@+id/tv_home"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="城市"android:textSize="20sp"tools:ignore="InvalidId" /><TextViewandroid:id="@+id/tv_home_text"android:layout_width="match_parent"android:layout_height="wrap_content"android:layout_alignBaseline="@id/tv_home"android:layout_toRightOf="@id/tv_home"android:gravity="center"android:text="北京"android:textSize="20sp" /></RelativeLayout><RelativeLayoutandroid:layout_width="match_parent"android:layout_height="40dp"android:layout_marginTop="10dp"android:gravity="center_vertical"android:paddingLeft="10dp"><TextViewandroid:id="@+id/tv_school"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="学校"android:textSize="20sp"tools:ignore="InvalidId" /><TextViewandroid:id="@+id/tv_school_text"android:layout_width="match_parent"android:layout_height="wrap_content"android:layout_alignBaseline="@id/tv_school"android:layout_toRightOf="@id/tv_school"android:gravity="center"android:text="北京大学"android:textSize="20sp" /></RelativeLayout><RelativeLayoutandroid:layout_width="match_parent"android:layout_height="40dp"android:layout_marginTop="10dp"android:gravity="center_vertical"android:paddingLeft="10dp"><TextViewandroid:id="@+id/tv_sign"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="个人签名"android:textSize="20sp"tools:ignore="InvalidId" /><TextViewandroid:id="@+id/tv_sign_text"android:layout_width="match_parent"android:layout_height="wrap_content"android:layout_alignBaseline="@id/tv_sign"android:layout_toRightOf="@id/tv_sign"android:gravity="center"android:text="这个人没有设置任何签名"android:textSize="14sp" /></RelativeLayout><Buttonandroid:id="@+id/btn_toEdit"android:layout_width="match_parent"android:layout_height="wrap_content"android:layout_margin="10dp"android:background="@drawable/btn_bg_selector"android:text="编辑资料" /><Buttonandroid:id="@+id/btn_logout"android:layout_width="match_parent"android:layout_height="wrap_content"android:layout_margin="10dp"android:background="@drawable/btn_bg_selector"android:text="退出登录" /></LinearLayout>
</ScrollView>

package com.example.logintest;import androidx.appcompat.app.AppCompatActivity;import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;public class UserProfileActivity extends AppCompatActivity implements View.OnClickListener {private TextView tvNickName,tvAccount,tvAge,tvGender,tvCity,tvHome,tvSchool,tvSign,tvBirthdayTime;private String birthDayTime;@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_user_profile);Button btn_toEdit = findViewById(R.id.btn_toEdit);btn_toEdit.setOnClickListener(this);Button btn_logout = findViewById(R.id.btn_logout);btn_logout.setOnClickListener(this);initView();}@Overrideprotected void onResume() {super.onResume();initData();}private void initData() {getDataFromspf();}private void getDataFromspf() {SharedPreferences spfRecord = getSharedPreferences("spfRecord",MODE_PRIVATE);String account = spfRecord.getString("account","");String nick_name = spfRecord.getString("nick_name","");String city = spfRecord.getString("city","");String gender = spfRecord.getString("gender","");String school = spfRecord.getString("school","");String birth_day_time = spfRecord.getString("birth_day_time","");String sign = spfRecord.getString("sign","");String home = spfRecord.getString("home","");String age = getAgeByBirthDay(birthDayTime);tvAccount.setText(account);tvNickName.setText(nick_name);tvAge.setText(age);tvHome.setText(home);tvSchool.setText(school);tvSign.setText(sign);tvBirthdayTime.setText(birth_day_time);tvGender.setText(gender);tvCity.setText(city);}private String getAgeByBirthDay(String birthDayTime) {if (TextUtils.isEmpty(birthDayTime)){return "";}try {int index = birthDayTime.indexOf("年");String result = birthDayTime.substring(0,index);int parseInt = Integer.parseInt(result);return String.valueOf(2021-parseInt);}catch (Exception e){e.printStackTrace();}return "";}private void initView() {tvAccount = findViewById(R.id.tv_account_text);tvNickName = findViewById(R.id.tv_nick_name);tvAge = findViewById(R.id.tv_age);tvHome = findViewById(R.id.tv_home_text);tvSchool = findViewById(R.id.tv_school_text);tvSign = findViewById(R.id.tv_sign_text);tvBirthdayTime = findViewById(R.id.tv_birth_time_text);tvGender = findViewById(R.id.tv_gender);tvCity = findViewById(R.id.tv_city);}@Overridepublic void onClick(View view) {if (view.getId() == R.id.btn_toEdit){Intent intent = new Intent(this, EditProfileActivity.class);startActivity(intent);} else if (view.getId() == R.id.btn_logout) {SharedPreferences spf = getSharedPreferences("spfRecord",MODE_PRIVATE);SharedPreferences.Editor edit = spf.edit();edit.putBoolean("isLogin",false);edit.apply();Intent intent = new Intent(this, LoginActivity.class);startActivity(intent);this.finish();}}
}

<?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:layout_height="match_parent"android:orientation="vertical"tools:context=".EditProfileActivity"><LinearLayoutandroid:layout_width="match_parent"android:layout_height="match_parent"android:orientation="vertical"><RelativeLayoutandroid:layout_width="match_parent"android:layout_height="250dp"><TextViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_margin="10dp"android:text="更换头像"android:textSize="20sp" /><ImageViewandroid:id="@+id/iv_avatar"android:layout_width="100dp"android:layout_height="100dp"android:layout_centerInParent="true"android:src="@mipmap/ic_launcher" /><LinearLayoutandroid:layout_width="match_parent"android:layout_height="wrap_content"android:layout_below="@+id/iv_avatar"android:layout_marginTop="5dp"android:gravity="center"android:orientation="horizontal"><Buttonandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:background="@drawable/btn_bg_selector"android:text="拍照" /><Buttonandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_marginLeft="10dp"android:background="@drawable/btn_bg_selector"android:text="相册" /></LinearLayout></RelativeLayout><LinearLayoutandroid:layout_width="match_parent"android:layout_height="wrap_content"android:layout_marginLeft="10dp"android:layout_marginTop="10dp"android:layout_marginRight="10dp"android:gravity="center_vertical"android:orientation="horizontal"><TextViewandroid:id="@+id/tv_account"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="账号:"android:textSize="25sp" /><EditTextandroid:id="@+id/et_account_text"android:layout_width="match_parent"android:layout_height="50dp"android:layout_marginLeft="10dp"android:background="@drawable/edit_text_bg"android:hint="请输入你的账号"android:paddingLeft="5dp"android:textSize="18sp" /></LinearLayout><LinearLayoutandroid:layout_width="match_parent"android:layout_height="wrap_content"android:layout_marginLeft="10dp"android:layout_marginTop="10dp"android:layout_marginRight="10dp"android:gravity="center_vertical"android:orientation="horizontal"><TextViewandroid:id="@+id/tv_nick_name"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="昵称:"android:textSize="25sp" /><EditTextandroid:id="@+id/et_nick_name_text"android:layout_width="match_parent"android:layout_height="50dp"android:layout_marginLeft="10dp"android:background="@drawable/edit_text_bg"android:hint="请输入你的账号"android:paddingLeft="5dp"android:textSize="18sp" /></LinearLayout><LinearLayoutandroid:layout_width="match_parent"android:layout_height="wrap_content"android:layout_margin="10dp"android:gravity="center_vertical"android:orientation="horizontal"><TextViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:text="性别"android:textSize="20sp"/><RadioGroupandroid:layout_width="match_parent"android:layout_height="wrap_content"android:orientation="horizontal"android:gravity="center"><RadioButtonandroid:id="@+id/rb_boy"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="男"/><RadioButtonandroid:id="@+id/rb_girl"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="女"android:layout_marginLeft="10dp"/></RadioGroup></LinearLayout><LinearLayoutandroid:layout_width="match_parent"android:layout_height="wrap_content"android:layout_marginLeft="10dp"android:layout_marginTop="10dp"android:layout_marginRight="10dp"android:orientation="horizontal"><TextViewandroid:id="@+id/tv_birth_time"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="出生日期:"android:textSize="25sp" /><TextViewandroid:id="@+id/tv_birth_time_text"android:layout_width="match_parent"android:layout_height="40dp"android:layout_marginLeft="10dp"android:text="1998年3月23 15点25分"android:paddingLeft="5dp"android:textSize="18sp" /><ImageViewandroid:layout_width="20dp"android:layout_height="20dp"android:layout_gravity="center_vertical"android:src="@drawable/baseline_arrow_forward_24"android:layout_marginLeft="30dp"/></LinearLayout><LinearLayoutandroid:layout_width="match_parent"android:layout_height="wrap_content"android:layout_marginLeft="10dp"android:layout_marginTop="10dp"android:layout_marginRight="10dp"android:gravity="center_vertical"android:orientation="horizontal"><TextViewandroid:id="@+id/tv_home"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="城市:"android:textSize="25sp" /><androidx.appcompat.widget.AppCompatSpinnerandroid:id="@+id/sp_city"android:layout_width="match_parent"android:layout_height="50dp"android:layout_marginLeft="10dp"android:background="@drawable/edit_text_bg"android:entries="@array/cities"android:spinnerMode="dropdown"android:paddingLeft="5dp"android:textSize="18sp" /></LinearLayout><LinearLayoutandroid:layout_width="match_parent"android:layout_height="wrap_content"android:layout_marginLeft="10dp"android:layout_marginTop="10dp"android:layout_marginRight="10dp"android:gravity="center_vertical"android:orientation="horizontal"><TextViewandroid:id="@+id/tv_school"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="学校:"android:textSize="25sp" /><EditTextandroid:id="@+id/et_school_text"android:layout_width="match_parent"android:layout_height="50dp"android:layout_marginLeft="10dp"android:background="@drawable/edit_text_bg"android:hint="请输入你的学校"android:paddingLeft="5dp"android:textSize="18sp" /></LinearLayout><LinearLayoutandroid:layout_width="match_parent"android:layout_height="wrap_content"android:layout_marginLeft="10dp"android:layout_marginTop="10dp"android:layout_marginRight="10dp"android:gravity="center_vertical"android:orientation="vertical"><TextViewandroid:id="@+id/tv_sign"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="个人签名:"android:textSize="25sp" /><EditTextandroid:id="@+id/et_sign_text"android:layout_width="match_parent"android:layout_height="100dp"android:background="@drawable/edit_text_bg"android:hint="请设置你的个人签名"android:textSize="18sp" /></LinearLayout><Buttonandroid:id="@+id/btn_save"android:layout_width="match_parent"android:layout_height="wrap_content"android:layout_margin="10dp"android:background="@drawable/btn_bg_selector"android:text="保存" /></LinearLayout>
</ScrollView>

package com.example.logintest;import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.AppCompatSpinner;import android.app.DatePickerDialog;
import android.app.TimePickerDialog;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.AdapterView;
import android.widget.Button;
import android.widget.DatePicker;
import android.widget.EditText;
import android.widget.RadioButton;
import android.widget.TextView;
import android.widget.TimePicker;public class EditProfileActivity extends AppCompatActivity implements View.OnClickListener {private EditText etNickName,etAccount,etSchool,etSign;private  TextView tvBirthDayTime;private RadioButton rbBoy,rbGirl;private AppCompatSpinner spinnerCity;private String[] cities;private int selectedCityPosition;private String selectedCity;private String birthDay;private String birthDayTime;@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_edit_profile);Button btn_save = findViewById(R.id.btn_save);btn_save.setOnClickListener(this);initView();initData();initEvent();}private void initView() {etAccount = findViewById(R.id.et_account_text);etNickName = findViewById(R.id.et_nick_name_text);etSchool = findViewById(R.id.et_school_text);etSign = findViewById(R.id.et_sign_text);tvBirthDayTime = findViewById(R.id.tv_birth_time_text);rbBoy = findViewById(R.id.rb_boy);rbGirl = findViewById(R.id.rb_girl);spinnerCity = findViewById(R.id.sp_city);}private void initData() {cities = getResources().getStringArray(R.array.cities);getDataFromspf();}private void getDataFromspf() {SharedPreferences spfRecord = getSharedPreferences("spfRecord",MODE_PRIVATE);String account = spfRecord.getString("account","");String nick_name = spfRecord.getString("nick_name","");String age = spfRecord.getString("age","");String city = spfRecord.getString("city","");String gender = spfRecord.getString("gender","");String school = spfRecord.getString("school","");String birth_day_time = spfRecord.getString("birth_day_time","");String sign = spfRecord.getString("sign","");String home = spfRecord.getString("home","");etAccount.setText(account);etNickName.setText(nick_name);etSchool.setText(age);etSign.setText(home);tvBirthDayTime.setText(birthDayTime);if (TextUtils.equals("男",gender)){rbBoy.setChecked(true);}if (TextUtils.equals("女",gender)){rbGirl.setChecked(true);}for (int i = 0; i < cities.length; i++) {if (TextUtils.equals(cities[i],city)){selectedCityPosition = i;break;}}spinnerCity.setSelection(selectedCityPosition);}private void initEvent() {spinnerCity.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {@Overridepublic void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {selectedCityPosition = i;selectedCity = cities[i];}@Overridepublic void onNothingSelected(AdapterView<?> adapterView) {}});tvBirthDayTime.setOnClickListener(new View.OnClickListener() {@Overridepublic void onClick(View view) {new DatePickerDialog(EditProfileActivity.this, new DatePickerDialog.OnDateSetListener() {@Overridepublic void onDateSet(DatePicker datePicker, int i, int i1, int i2) {int realMonth = i1+1;birthDay = i+"年"+realMonth+"月"+i2+"日";popTimePick();}},2024,2,17).show();}});}private void popTimePick() {new TimePickerDialog(this, new TimePickerDialog.OnTimeSetListener() {@Overridepublic void onTimeSet(TimePicker timePicker, int i, int i1) {birthDayTime = birthDay+i+"时"+i1+"分";tvBirthDayTime.setText(birthDayTime);}},12,36,true).show();}@Overridepublic void onClick(View view) {if (view.getId() == R.id.btn_save){String account = etAccount.getText().toString();String sign = etSign.getText().toString();String school = etSchool.getText().toString();String nickName = etNickName.getText().toString();String gender = "男";if (rbBoy.isChecked()){gender = "男";}if (rbGirl.isChecked()){gender = "女";}SharedPreferences spfRecord = getSharedPreferences("spfRecord",MODE_PRIVATE);SharedPreferences.Editor editor = spfRecord.edit();editor.putString("account",account);editor.putString("sign",sign);editor.putString("school",school);editor.putString("nick_name",nickName);editor.putString("birth_day_time",birthDayTime);editor.putString("city",selectedCity);editor.putString("gender",gender);editor.apply();this.finish();}}
}

相关文章:

23.实战演练--个人主页

<?xml version"1.0" encoding"utf-8"?> <manifest xmlns:android"http://schemas.android.com/apk/res/android"xmlns:tools"http://schemas.android.com/tools"><applicationandroid:allowBackup"true"an…...

[剪藏] - 任泽平年终演讲精华:点燃希望——2024中国经济十大预测

任泽平年终演讲精华&#xff1a;点燃希望——2024中国经济十大预测 泽平宏观 2023-12-23 08:01 发表于上海 12月22日22:30&#xff0c;任泽平年终秀“点燃希望乐观者前行——2024中国经济十大预测”圆满收官。 泽平宏观、北京广播电视台、上海高净值研究院、北京时间等携手打…...

基于LabVIEW的压力传感器测试系统

摘要 现在各类压力传感器已广泛应用于各种工业自控环境&#xff0c;对压力传感器的研究 及应用&#xff0c;既可以体现一个国家的科技发展水平&#xff0c;又可以提升国家的综合国力&#xff0c;还 可以在丰富、方便和智能化人们的生活方面做出重要的贡献。而针对不同仪器组 成…...

Vue 如何使用WebSocket与服务器建立链接 持续保持通信

WebSocket 浏览器通过JavaScript向服务器发出建立WebSocket链接的请求&#xff0c;链接建立后&#xff0c;客户端和服务器端就可以通过TCP链接直接交互数据。WebSocket链接后可以通过send()方法来向服务器发送数据&#xff0c;并通过onnessage事件来接受服务器返回的数据。 创…...

自动驾驶模拟器

目录 Carla 自动驾驶模拟器 Udacity自动驾驶模拟器 Carla 自动驾驶模拟器 pip install carla 需要下载地图 Udacity自动驾驶模拟器...

Jmeter的文件参数化:CSV数据文件设置和_CSVRead函数

一、CSV数据文件设置 1、简介 CSV数据文件配置&#xff08;CSV Data Set Config&#xff09;可以将CSV文件中数据读入自定义变量中 Jmeter中CSV数据文件配置的界面如下图所示&#xff1a; 其中&#xff1a; &#xff08;1&#xff09;文件编码 文件的编码格式&#xff0c;与所…...

windows编译TensorFlowServing

概述 整个编译打包过程的总体思路&#xff0c;是参照在linux下的编译流程&#xff0c;配置环境&#xff0c;执行编译命令&#xff0c;根据编译器/链接器反馈的错误&#xff0c;修改相应的源码或者相关库文件的存放路径&#xff0c;编译出windows平台下静态库和二进制执行文件。…...

debian 12 安装 浏览器 Epiphany

Epiphany 什么epiphany-browser epiphany-browser 是&#xff1a; Epiphany 是一款简单而强大的 GNOME 网络浏览器&#xff0c;针对 非技术用户。它的原则是简单和标准 合规。 简单性是通过精心设计的用户界面和依赖来实现的 在用于执行外部任务&#xff08;如阅读 电子邮件…...

Kafka-消费者-KafkaConsumer分析

与KafkaProducer不同的是&#xff0c;KafkaConsumer不是一个线程安全的类。 为了便于分析&#xff0c;我们认为下面介绍的所有操作都是在同一线程中完成的&#xff0c;所以不需要考虑锁的问题。 这种设计将实现多线程处理消息的逻辑转移到了调用KafkaConsumer的代码中&#x…...

Spring | Spring中的Bean--下

Spring中的Bean: 4.Bean的生命周期5.Bean的配装配式 ( 添加Bean到IOC容器的方式 依赖注入的方式 )5.1 基于XML的配置5.2 基于Annotation (注解) 的装配 (更常用&#xff09;5.3 自动装配 4.Bean的生命周期 Spring容器可以管理 singleton作用域的Bean的生命周期&#xff0c;在此…...

本周五上海见 第二届证券基金行业先进计算技术大会暨2024低时延技术创新实践论坛(上海站)即将召开

低时延技术是证券基金期货领域业务系统的核心技术&#xff0c;是打造极速交易系统领先优势的关键&#xff0c;也是证券基金行业关注的前沿技术热点。 1月19日下午&#xff0c;第二届证券基金行业先进计算技术大会暨2024低时延技术创新实践论坛&#xff08;上海站&#xff09;即…...

怎么安装IK分词器

.安装IK分词器 1.在线安装ik插件&#xff08;较慢&#xff09; # 进入容器内部 docker exec -it elasticsearch /bin/bash ​ # 在线下载并安装 ./bin/elasticsearch-plugin install https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v7.12.1/elastics…...

【踩坑】flask_uploads报错cannot import name ‘secure_filename‘

转载请注明出处&#xff1a;小锋学长生活大爆炸[xfxuezhang.cn] 背景说明 截至目前&#xff0c;用新版的flask实现文件上传(用到flask_uploads库)&#xff0c;会出现这个问题。 问题原因 版本问题&#xff0c;新的werkzeug已经把secure_filename的位置改了。 解决方法 手动修改…...

AI编程可视化Java项目拆解第一弹,解析本地Java项目

之前分享过一篇使用 AI 可视化 Java 项目的文章&#xff0c;同步在 AI 破局星球、知乎、掘金等地方都分享了。 原文在这里AI 编程&#xff1a;可视化 Java 项目 有很多人感兴趣&#xff0c;我打算写一个系列文章拆解这个项目&#xff0c;大家多多点赞支持~ 今天分享的是第一…...

使用arcgis pro是类似的控件样式 WPF

1.资源加载 <controls:ProWindow.Resources><ResourceDictionary><ResourceDictionary.MergedDictionaries><extensions:DesignOnlyResourceDictionary Source"pack://application:,,,/ArcGIS.Desktop.Framework;component\Themes\Default.xaml&quo…...

C语言所有字符串函数举例如何使用

strcpy: 将一个字符串复制到另一个字符串中 char source[] "Hello"; char destination[10]; strcpy(destination, source);strcat: 将一个字符串连接到另一个字符串的末尾 char str1[20] "Hello"; char str2[] "World"; strcat(str1, str2)…...

ArcGIS Pro 如何新建布局

你是否已经习惯了在ArcGIS中数据视图和布局视图之间来回切换&#xff0c;到了ArcGIS Pro中却找不到二者之间切换的按钮&#xff0c;即使新建布局后却发现地图怎么却是一片空白。 这一切的一切都是因为ArcGIS Pro的功能框架完全不同&#xff0c;这里为大家介绍一下在ArcGIS Pro…...

如何解决态势感知中的“时隐时现”问题

解决态势感知中的“时隐时现”问题有以下几个方法&#xff1a; 1、确保所有关键的监控设备和传感器正常运行&#xff0c;能够及时和准确地检测到各种异常情况。 2、引入先进的技术手段。例如使用人工智能和机器学习算法来识别和分析大量的数据&#xff0c;快速发现异常和威胁&a…...

为什么JavaScript中0.1 + 0.2 ≠ 0.3

JavaScript中的浮点数运算有时候会出现一点偏差。下面解释为什么0.1 0.2 ≠ 0.3,以及如果你需要精确运算应该怎么做。 如果1 2 3,那么为什么在JavaScript中0.1 0.2 ≠ 0.3?这个原因与计算机科学和浮点数运算有关。 我建议你打开浏览器的控制台,输入0.1 0.2来查看结果。…...

Unity关于纹理图片格式带来的内存问题和对预制体批量格式和大小减半处理

我们经常会遇到内存问题&#xff0c;这次就是遇到很多图片的默认格式被改成了RGB32&#xff0c;导致Android打包后运行内存明显增加。 发生了什么 打包Android后&#xff0c;发现经常崩溃&#xff0c;明显内存可能除了问题&#xff0c;看了内存后发现了问题。 见下图&#xf…...

【SpringBoot】100、SpringBoot中使用自定义注解+AOP实现参数自动解密

在实际项目中,用户注册、登录、修改密码等操作,都涉及到参数传输安全问题。所以我们需要在前端对账户、密码等敏感信息加密传输,在后端接收到数据后能自动解密。 1、引入依赖 <dependency><groupId>org.springframework.boot</groupId><artifactId...

NLP学习路线图(二十三):长短期记忆网络(LSTM)

在自然语言处理(NLP)领域,我们时刻面临着处理序列数据的核心挑战。无论是理解句子的结构、分析文本的情感,还是实现语言的翻译,都需要模型能够捕捉词语之间依时序产生的复杂依赖关系。传统的神经网络结构在处理这种序列依赖时显得力不从心,而循环神经网络(RNN) 曾被视为…...

根据万维钢·精英日课6的内容,使用AI(2025)可以参考以下方法:

根据万维钢精英日课6的内容&#xff0c;使用AI&#xff08;2025&#xff09;可以参考以下方法&#xff1a; 四个洞见 模型已经比人聪明&#xff1a;以ChatGPT o3为代表的AI非常强大&#xff0c;能运用高级理论解释道理、引用最新学术论文&#xff0c;生成对顶尖科学家都有用的…...

力扣-35.搜索插入位置

题目描述 给定一个排序数组和一个目标值&#xff0c;在数组中找到目标值&#xff0c;并返回其索引。如果目标值不存在于数组中&#xff0c;返回它将会被按顺序插入的位置。 请必须使用时间复杂度为 O(log n) 的算法。 class Solution {public int searchInsert(int[] nums, …...

安卓基础(aar)

重新设置java21的环境&#xff0c;临时设置 $env:JAVA_HOME "D:\Android Studio\jbr" 查看当前环境变量 JAVA_HOME 的值 echo $env:JAVA_HOME 构建ARR文件 ./gradlew :private-lib:assembleRelease 目录是这样的&#xff1a; MyApp/ ├── app/ …...

android13 app的触摸问题定位分析流程

一、知识点 一般来说,触摸问题都是app层面出问题,我们可以在ViewRootImpl.java添加log的方式定位;如果是touchableRegion的计算问题,就会相对比较麻烦了,需要通过adb shell dumpsys input > input.log指令,且通过打印堆栈的方式,逐步定位问题,并找到修改方案。 问题…...

用鸿蒙HarmonyOS5实现中国象棋小游戏的过程

下面是一个基于鸿蒙OS (HarmonyOS) 的中国象棋小游戏的实现代码。这个实现使用Java语言和鸿蒙的Ability框架。 1. 项目结构 /src/main/java/com/example/chinesechess/├── MainAbilitySlice.java // 主界面逻辑├── ChessView.java // 游戏视图和逻辑├──…...

ui框架-文件列表展示

ui框架-文件列表展示 介绍 UI框架的文件列表展示组件&#xff0c;可以展示文件夹&#xff0c;支持列表展示和图标展示模式。组件提供了丰富的功能和可配置选项&#xff0c;适用于文件管理、文件上传等场景。 功能特性 支持列表模式和网格模式的切换展示支持文件和文件夹的层…...

jdbc查询mysql数据库时,出现id顺序错误的情况

我在repository中的查询语句如下所示&#xff0c;即传入一个List<intager>的数据&#xff0c;返回这些id的问题列表。但是由于数据库查询时ID列表的顺序与预期不一致&#xff0c;会导致返回的id是从小到大排列的&#xff0c;但我不希望这样。 Query("SELECT NEW com…...

Qt的学习(一)

1.什么是Qt Qt特指用来进行桌面应用开发&#xff08;电脑上写的程序&#xff09;涉及到的一套技术Qt无法开发网页前端&#xff0c;也不能开发移动应用。 客户端开发的重要任务&#xff1a;编写和用户交互的界面。一般来说和用户交互的界面&#xff0c;有两种典型风格&…...