Android之QQ新用户注册界面1
2016-09-01 00:40
302 查看
还没到睡觉时间所以再加了一个界面...
bg_titile
问题2替换方法:隐藏标题栏 -- 在 AndroidManifest 中添加 -- android:theme="@android:style/Theme.NoTitleBar" >
MainActivity (问题3)
图片素材
aa.png
-- ps用不了了,改不了颜色...
---------------------改是时候睡觉了...---------------------
<?xml version="1.0" encoding="utf-8"?> <resources xmlns:android="http://schemas.android.com/apk/res/android"> <style name="bg_title" parent="android:Theme"> <item name="android:windowTitleBackgroundStyle">@style/Titleground</item> <item name="android:windowTitleStyle">@style/windowTitleStyle</item> <item name="android:windowTitleSize">40dp</item> </style> <style name="Titleground"> <item name="android:background">#FFFFFF</item> </style> <style name="windowTitleStyle"> <item name="android:text">@string/pagename</item> <item name="android:textColor">#1CBAF5</item> <item name="android:paddingTop">2dp</item> <item name="android:paddingBottom">2dp</item> <item name="android:textSize">20sp</item> </style> </resources>
bg_titile
问题2替换方法:隐藏标题栏 -- 在 AndroidManifest 中添加 -- android:theme="@android:style/Theme.NoTitleBar" >
MainActivity (问题3)
package com.dragon.android.qqregist; import android.annotation.SuppressLint; import android.app.Activity; import android.graphics.Color; import android.os.Bundle; import android.view.View; import android.widget.AdapterView; import android.widget.AdapterView.OnItemSelectedListener; import android.widget.Button; import android.widget.CheckBox; import android.widget.CompoundButton; import android.widget.CompoundButton.OnCheckedChangeListener; import android.widget.EditText; import android.widget.Spinner; import android.widget.Toast; public class MainActivity extends Activity { private Spinner spinner = null; private EditText editText1; private Button button2; private Button button1; private CheckBox checkBox1; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.fragment_main); spinner = (Spinner) findViewById(R.id.spinner1); spinner.setSelection(0); editText1 = (EditText) findViewById(R.id.editText1); editText1.setHintTextColor(Color.GRAY); button2 = (Button) findViewById(R.id.button2); // 设置空间置顶 button2.bringToFront(); button1 = (Button) findViewById(R.id.button1); // spinner 选择监听事件 spinner.setOnItemSelectedListener(new OnItemSelectedListener() { @Override // parent当前spinner pos/id选中的值所在位置/行 public void onItemSelected(AdapterView<?> parent, View view, int pos, long id) { // 得到string-array String[] country = getResources().getStringArray( R.array.country); Toast.makeText(MainActivity.this, "你选择的是:" + country[pos], Toast.LENGTH_SHORT).show(); } @Override public void onNothingSelected(AdapterView<?> parent) { // Another interface callback } }); checkBox1 = (CheckBox) findViewById(R.id.checkBox1); checkBox1.setOnCheckedChangeListener(new OnCheckedChangeListener() { @Override @SuppressLint("NewApi") public void onCheckedChanged(CompoundButton view, boolean inChecked) { button1.setEnabled(inChecked); if (!inChecked) { // 设置按钮的背景 button1.setBackground(getResources().getDrawable( R.drawable.bg_button)); } else { button1.setBackground(getResources().getDrawable( R.drawable.bg_button_change)); } } }); } }
图片素材
aa.png
-- ps用不了了,改不了颜色...
---------------------改是时候睡觉了...---------------------
相关文章推荐
- Android推送技术研究
- Activity学习笔记
- Android之QQ登录界面
- Android Studio之GsonFormat用法
- Android onFinishInflate理解
- 其他工程做为module、Library导入AS工程,Module之间共享资源
- 使用AndroidStudio导出jar包
- Android开发环境搭建
- Android平台的防破解及逆向工程心得
- Android LayoutInflater 细节
- Android中的数据库
- (数据库)Android登录,注册界面简单实现。
- EditText光标颜色
- Android内存优化--onTrimMemory
- Android中的Spinner的运用。
- Android Java层DNS流程(图)
- Android Studio NDK开发 正确调用jni 及加入第三方so库需要注意的问题 .
- 去除TextView后面的省略号
- Android自定义控件步骤
- Android中Bundle类的作用