网站后台如何添加视频,全国中高风险地区最新名单,网站正在建设中提示页面设计欣赏,宁波受欢迎全网seo优化这段代码的关键主要是在我们的相对布局以及线性布局上面#xff0c;我们首先在总体布局里设置为线性布局#xff0c;然后再在里面设置为相对布局#xff0c;这是一个十分常见的XML布局模式。废话不多说#xff0c;直接上代码#xff1a;一.activity.xmlandroid:layout…这段代码的关键主要是在我们的相对布局以及线性布局上面我们首先在总体布局里设置为线性布局然后再在里面设置为相对布局这是一个十分常见的XML布局模式。废话不多说直接上代码一.activity.xmlandroid:layout_widthmatch_parentandroid:layout_height160dpandroid:padding16dpandroid:layout_margin0dpandroid:layout_widthmatch_parentandroid:layout_heightwrap_contentandroid:padding16dpandroid:layout_margin0dpandroid:idid/accountandroid:layout_widthmatch_parentandroid:layout_heightwrap_contentandroid:layout_marginBottom16dpandroid:hintQQ号/密码/邮箱//android:layout_belowid/accountandroid:idid/passwordandroid:layout_widthmatch_parentandroid:layout_heightwrap_contentandroid:passwordtrueandroid:hint密码//android:layout_widthmatch_parentandroid:layout_height33dpandroid:padding0dpandroid:layout_margin0dpandroid:idid/remember_passandroid:layout_widthwrap_contentandroid:layout_heightwrap_contentandroid:text记住密码/android:layout_widthmatch_parentandroid:layout_heightwrap_contentandroid:layout_margin16dpandroid:idid/loginandroid:layout_widthmatch_parentandroid:layout_heightwrap_contentandroid:text登录android:textColor#fffandroid:background#008cc9/android:idid/forget_pwdandroid:layout_belowid/loginandroid:layout_widthwrap_contentandroid:layout_heightwrap_contentandroid:backgroundnullandroid:textColor#2999ceandroid:gravitystartandroid:layout_marginTop16dpandroid:textSize16dpandroid:text忘记密码/android:idid/registerandroid:layout_belowid/loginandroid:layout_widthwrap_contentandroid:layout_heightwrap_contentandroid:backgroundnullandroid:textColor#2999ceandroid:gravityendandroid:text新用户注册android:layout_marginTop16dpandroid:textSize16dpandroid:layout_alignParentRighttrue/android:layout_widthmatch_parentandroid:layout_height80dpandroid:padding16dpandroid:layout_margin0dpandroid:layout_widthwrap_contentandroid:layout_heightwrap_content /二.main.javapackage com.example.lenovo.fqq;import android.content.Intent;import android.support.v7.app.ActionBar;import android.support.v7.app.AppCompatActivity;import android.os.Bundle;import android.view.View;import android.widget.Button;public classMain3Activity extends AppCompatActivity {Overrideprotected voidonCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_main3);Button button(Button) findViewById(R.id.login);button.setOnClickListener(newView.OnClickListener() {Overridepublic voidonClick(View v) {Intent intentnew Intent(Main3Activity.this,Main2Activity.class);startActivity(intent);}});ActionBar agetSupportActionBar();if(a!null){a.hide();}}}其中的代码ActionBar agetSupportActionBar();if(a!null){a.hide();}}}主要是为了能够将我们的标题栏隐藏不然的话就会显示出标题栏达不到我们仿写的效果了。Button button(Button) findViewById(R.id.login);button.setOnClickListener(new View.OnClickListener() {Overridepublic void onClick(View v) {Intent intentnew Intent(Main3Activity.this,Main2Activity.class);startActivity(intent);}});上面这一段代码主要是用到了活动的跳转不然登录是登录不进去的这里因为我们直接使用了java当中活动的跳转。点击登录就会立刻跳转到下一个界面进行登录当然TextView简介TextView是View的直接子类。它是一个文本显示控件提供了基本的显示文本的功能并且是大部分UI控件的父类因为大部分UI控件都需要展示信息。如果仅仅是展示文本那么TextView的作用就太小了所以它还预定义了一些类似于HTML的标签通过这些标签可以使TextView控件显示不同的颜色、大小、字体、图片、链接。这些HTML标签都需要android.text.Html类的支持但是并不包括所有的HTML标签。常用的可以再TextView中设定的标签有设置颜色和字体。设置字体大号设置字体小号\斜体\粗体连接网址图片使用这些标签可以用Html.fromHtml方法将这些标签的字符串转换成CharSequence接口然后在TextView.setText()中进行设置。如果需要响应设置的HTML标签进行响应需要设置TextView.setMovementMethod(LinkMovementMethod.getInstance())。CharSequence为接口类型大家可能对其有点陌生但是它的子类肯定会让大家有熟悉的感觉String、StringBuffer、StringBuilder、SpannableString、SpannableStringBuilder都是其子类它包括了字符串的所有类因为面向对象的多态性在这里把他理解成字符串类的抽象即可。除了使用HTML标签的方式设定显示文本中的URL地址、邮箱地址、电话等产生超链接出发相应的服务可以使用android:autoLink属性来设置以下是android:autoLink属性的介绍None默认的不匹配任何连接。web网址。email邮箱。phone电话号码。map匹配映射网址。all匹配所有连接。最终搞定实现具体效果如下