部分总结

在使用Android Studio时用到的知识

隐藏标题栏

方法一:在java语言编写页面(src-java)输入以下代码:

                  if(getSupportActionBar()!=null){

                      getSupportActionBar().hide;

                  }

方法二:在src-res-values-styles.xml页面将<style name.. 一栏改为:

               <style name="App Theme" parent="Theme.AppCompat.Light.NoActionBar">


提示文字

在显示模块<LinearLayout-<EditText中填入android:hint="要提示的文字内容"

记住密码

在编写xml 页面输入以下内容:

<LinearLayout
    android:orientation="horizontal"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">
    <CheckBox
        android:id="@+id/remember_pass"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />
    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textSize="18sp"
        android:text="记住密码"/>
</LinearLayout>
即可实现记住密码功能,下次进入时不需要再次输入密码。
跳转页面
点击一个按钮实现页面跳转,这就需要按钮的监听,从而实现页面跳转。
例如在上例图片中点击注册实现按钮。
我们需要在java语言编写页面写下以下代码:
先在public void onCreate(Bundle savedInstanceState) {之中写下:
Button button1 = (Button) findViewById(R.id.login);
button1.setOnClickListener(this);
然后在public void onClick(View v) {中写下:
Intent intent=new Intent(MainActivity.this,Main2Activity.class);
startActivity(intent);
当然这就必须要写下第二页面了,这就实现了页面的跳转。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值