定义:
<TextView
android:id="@+id/register_link"
android:text="@string/login_register_link"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:textColor="#888"
android:textColorLink="#FF0066CC"/>
TextView是支持简单的html标签的,如<a>标签,但并不是支持所有标签,支持更复杂的html标签得用webView组件。
<ImageView
android:src="@drawable/logo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toLeftOf="@id/miniTwitter_logo"
android:layout_alignBottom="@id/miniTwitter_logo"
android:paddingBottom="8dp"/>
字符串的定义:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="hello">Hello World, LoginActivity!</string>
<string name="login_label_username">帐号</string>
<string name="login_label_password">密码</string>
<string name="login_label_signin">登 录</string>
<string name="login_status_logging_in">登录中...</string>
<string name="login_username_hint">Email或手机号</string>
<string name="login_register_link">没有帐号? <a href="#" mce_href="#">注册</a></string>
<string name="app_name">miniTwitter</string>
</resources>
背景色为渐变色:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:startColor="#FFACDAE5"
android:endColor="#FF72CAE1"
android:angle="45"
/>
</shape>
登陆演示代码:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/background_login">
<!-- padding 内边距 layout_margin 外边距
android:layout_alignParentTop 布局的位置是否处于顶部 -->
<RelativeLayout
android:id="@+id/login_div"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
MiniTwitter记住密码等功能实现
最新推荐文章于 2021-05-27 16:10:36 发布