欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Android實(shí)現(xiàn)QQ新用戶注冊(cè)界面遇到問(wèn)題及解決方法

 更新時(shí)間:2016年09月01日 11:07:37   作者:西門吃雪  
這篇文章主要介紹了Android實(shí)現(xiàn)QQ新用戶注冊(cè)界面遇到問(wèn)題及解決方法,非常不錯(cuò),具有參考借鑒價(jià)值,需要的朋友可以參考下

在上篇文章給大家介紹了Android實(shí)現(xiàn)QQ登錄界面遇到問(wèn)題及解決方法,本篇文章繼續(xù)給大家介紹有關(guān)android qq界面知識(shí)。

先給大家展示下效果圖:

問(wèn)題:

1、下拉列表(因?yàn)檫€沒(méi)看到這里...)

2、標(biāo)題欄顯示問(wèn)題

3、按鈕的 Enable 設(shè)置  

以下是代碼:

布局 fragment_main(問(wèn)題1)

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
 xmlns:tools="http://schemas.android.com/tools"
 android:layout_width="match_parent"
 android:layout_height="match_parent"
 android:focusable="true"
 android:focusableInTouchMode="true"
 android:background="#F7F7F9"
 tools:context="com.dragon.android.qqregist.MainActivity$PlaceholderFragment" >
 <Button
  android:id="@+id/button2"
  android:layout_width="wrap_content"
  android:layout_height="50dp"
  android:layout_alignParentTop="true"
  android:background="#ffffff"
  android:drawableLeft="@drawable/aa"
  android:text="@string/button2"
  android:textColor="#1CBAF5" />
 <TextView
  android:id="@+id/textView2"
  android:layout_width="match_parent"
  android:layout_height="50dp"
  android:layout_alignBaseline="@+id/button2"
  android:layout_alignBottom="@+id/button2"
  android:background="#ffffff"
  android:gravity="center"
  android:text="@string/pagename"
  android:textColor="#1CBAF5" />
 <LinearLayout
  android:id="@+id/linear"
  android:layout_width="match_parent"
  android:layout_height="wrap_content"
  android:orientation="horizontal"
  android:layout_below="@id/button2"
  android:paddingTop="30dp"
  android:paddingBottom="20dp" >
 <Spinner
  android:id="@+id/spinner1"
  android:layout_width="0dp"
  android:layout_height="wrap_content"
  android:background="@drawable/bg_spinner"
  android:layout_weight="1" 
  android:entries="@array/country"/>
 <EditText 
  android:id="@+id/editText1"
  android:layout_width="0dp"
  android:layout_height="wrap_content"
  android:layout_weight="2" 
  android:background="@drawable/bg_edittext"
  android:ems="10"
  android:inputType="phone"
  android:hint="@string/innum"
  android:color="#000000"
  android:textSize="15sp" >
 </EditText>
 </LinearLayout>
 <Button
  android:id="@+id/button1"
  android:layout_width="match_parent"
  android:layout_height="wrap_content"
  android:layout_marginLeft="10dp"
  android:layout_marginRight="10dp"
  android:layout_below="@id/linear"
  android:enabled="false"
  android:background="@drawable/bg_button"
  android:text="@string/button"
  android:gravity="center"
  android:textColor="#FFFFFF" />
 <CheckBox
  android:id="@+id/checkBox1"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:layout_marginTop="10dp"
  android:layout_marginLeft="10dp"
  android:layout_below="@id/button1"
  android:text="@string/sure"
  android:textSize="12sp"
  android:textColor="#A6A6A7" />
 <TextView
  android:id="@+id/textView1"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:layout_alignBaseline="@+id/checkBox1"
  android:layout_alignBottom="@+id/checkBox1"
  android:layout_marginLeft="10dp"
  android:layout_toRightOf="@+id/checkBox1"
  android:autoLink="all"
  android:text="@string/protocol"
  android:textSize="12sp" />
</RelativeLayout>
fragment_main

EditText、Spinner 以及 Button 修改前后的背景

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
 <stroke android:width="1px" android:color="#BEBEBE"/>
 <solid android:color="#FFFFFF" />
 <padding 
  android:left="10dp"
  android:top="10dp"
  android:bottom="10dp"/>
</shape>
bg_edittext
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
 <stroke android:width="1px" android:color="#BEBEBE"/>
 <solid android:color="#FFFFFF" />
 <padding 
  android:left="10dp"
  android:top="10dp"
  android:bottom="10dp"/>
</shape>
bg_spinner
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
 <solid android:color="#808080"/>
 <corners android:radius="10dp"/>
 <padding 
  android:top="10dp" 
  android:bottom="10dp"/>
</shape>
bg_button
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
 <solid android:color="#1CBAF5"/>
 <corners android:radius="10dp"/>
 <padding 
  android:top="10dp" 
  android:bottom="10dp"/>
</shape>
bg_buttin_change

Spinner 的下拉數(shù)據(jù) arrays

<?xml version="1.0" encoding="utf-8"?>
<resources>
 <string-array name="country">
  <item >中國(guó)  +86</item>
  <item >香港  +852</item>
  <item >澳門  +853</item>
  <item >臺(tái)灣  +886</item>
  <item >日本  +81</item>
  <item >美國(guó)  +1</item>
  <item >英國(guó)  +44</item>
 </string-array>
</resources>
arrays

標(biāo)題欄的背景(問(wèn)題2 -- 放棄)

<?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

問(wèn)題2替換方法:隱藏標(biāo)題欄 -- 在 AndroidManifest 中添加 -- android:theme="@android:style/Theme.NoTitleBar" >

MainActivity (問(wèn)題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);
// 設(shè)置空間置頂
button2.bringToFront();
button1 = (Button) findViewById(R.id.button1);
// spinner 選擇監(jiān)聽(tīng)事件
spinner.setOnItemSelectedListener(new OnItemSelectedListener() {
@Override
// parent當(dāng)前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) {
// 設(shè)置按鈕的背景
button1.setBackground(getResources().getDrawable(
R.drawable.bg_button));
} else {
button1.setBackground(getResources().getDrawable(
R.drawable.bg_button_change));
}
}
});
}
}

以上所述是小編給大家介紹的Android實(shí)現(xiàn)QQ新用戶注冊(cè)界面遇到問(wèn)題及解決方法,希望對(duì)大家有所幫助,如果大家有任何疑問(wèn)請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)腳本之家網(wǎng)站的支持!

相關(guān)文章

  • Android shell命令行中過(guò)濾adb logcat輸出的幾種方法

    Android shell命令行中過(guò)濾adb logcat輸出的幾種方法

    本文主要介紹Android shell命令行中過(guò)濾adb logcat輸出的方法,這里整理了幾種方法,并詳細(xì)的說(shuō)明,有需要的朋友可以參考下
    2016-08-08
  • Android自定義ViewGroup之CustomGridLayout(一)

    Android自定義ViewGroup之CustomGridLayout(一)

    這篇文章主要為大家詳細(xì)介紹了Android自定義ViewGroup之CustomGridLayout的相關(guān)資料,感興趣的小伙伴們可以參考一下
    2016-09-09
  • android圖像繪制(五)畫布保存為指定格式/大小的圖片

    android圖像繪制(五)畫布保存為指定格式/大小的圖片

    將圖片進(jìn)行編輯(放縮,涂鴉等),最后保存成指定格式、大小的圖片,接下來(lái)將介紹保存方法,感興趣的朋友可以了解下啊
    2013-01-01
  • Android自定義加載圈動(dòng)畫效果

    Android自定義加載圈動(dòng)畫效果

    這篇文章主要為大家詳細(xì)介紹了Android自定義加載圈動(dòng)畫效果,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2017-08-08
  • 獲取Android界面性能數(shù)據(jù)的快捷方法

    獲取Android界面性能數(shù)據(jù)的快捷方法

    這篇文章主要介紹了獲取Android界面性能數(shù)據(jù)的快捷方法,幫助大家更好的理解和學(xué)習(xí)使用Android開發(fā),感興趣的朋友可以了解下
    2021-04-04
  • android 二次打包完成apk多渠道打包的方法

    android 二次打包完成apk多渠道打包的方法

    本篇文章主要介紹了android 二次打包完成apk多渠道打包的方法,小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧
    2017-10-10
  • Android基礎(chǔ)之隱藏標(biāo)題欄/設(shè)置為全屏/橫豎屏切換

    Android基礎(chǔ)之隱藏標(biāo)題欄/設(shè)置為全屏/橫豎屏切換

    大家好,本篇文章主要講的是Android基礎(chǔ)之隱藏標(biāo)題欄/設(shè)置為全屏/橫豎屏切換,感興趣的同學(xué)趕快來(lái)看一看吧,對(duì)你有幫助的話記得收藏一下,方便下次瀏覽
    2021-12-12
  • Android實(shí)現(xiàn)左滑關(guān)閉窗口

    Android實(shí)現(xiàn)左滑關(guān)閉窗口

    這篇文章主要為大家詳細(xì)介紹了Android實(shí)現(xiàn)左滑關(guān)閉窗口,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2022-04-04
  • 常用Android布局文件優(yōu)化技巧總結(jié)

    常用Android布局文件優(yōu)化技巧總結(jié)

    Android布局加載是Android應(yīng)用程序的重要組成部分,布局加載是指將 XML文件中定義的視圖層次結(jié)構(gòu)加載到內(nèi)存中,在這篇文章中,我們將深入探討 Android 布局加載的原理,包括 Android 布局文件的結(jié)構(gòu)和布局文件的常見(jiàn)問(wèn)題等方面,需要的朋友可以參考下
    2023-07-07
  • Android編程之簡(jiǎn)單啟動(dòng)畫面實(shí)現(xiàn)方法

    Android編程之簡(jiǎn)單啟動(dòng)畫面實(shí)現(xiàn)方法

    這篇文章主要介紹了Android編程之簡(jiǎn)單啟動(dòng)畫面實(shí)現(xiàn)方法,結(jié)合實(shí)例形式較為詳細(xì)的分析了開機(jī)啟動(dòng)畫面的制作步驟及布局、Activity跳轉(zhuǎn)、權(quán)限控制等的相關(guān)操作技巧,需要的朋友可以參考下
    2016-11-11

最新評(píng)論