導航:首頁 > 操作系統 > android登錄按鈕

android登錄按鈕

發布時間:2022-05-12 04:51:36

android UI問題:像qq登陸界面一樣,我想要在輸入文字的時候下面的登錄按鈕不要被輸入法遮住

修改AndroidManifest.xml文件,在Activity屬性中加一條:
android:windowSoftInputMode="adjustResize"
這樣應該就行了

⑵ android 開發中想實現登錄按鈕點擊後改變文本,登錄完成後再變回來為何實現不了

LZ你這個用到了聯網把,一般來說聯網程序是在線程中進行的,如果LZ想在線程中改變UI,應該知道得用handler才行。

⑶ Android登陸後如何判定是否登錄 並且在已經登錄的時候如何獲取用戶信息

給你詳細講一下。 比如系統有個登陸頁面(login.jsp): name:_________ password:____________ (登陸按鈕) 你按下登陸按鈕,就根據name和password去資料庫裡面查,如果判斷有此用戶並且密碼正確,就設置一個session的鍵對應的值,鍵名字自己取,統一即可,比如"userInfo",代碼就是servlet的doPost裡面 HttpSession session = request.getSession(); Hashtable userInfo = new Hashtable(); userInfo.setAttribute("userName", request.getParameter("userName"); userInfo.setAttribute("passWords", Util.toSecret( request.getParameter("passWords)); //密碼最好加密 session.setAttribute("userInfo", userInfo); session是在一定時期(超時時間內)一直存在的,這段時間內你可以隨時判斷用戶是否合法,否則就退回登陸頁面。 在任何除了登陸頁面以外的頁面訪問,只需判斷有沒有這個鍵值,沒就到登陸頁面,否則進正常頁面。(最好寫在servlet中,讓servlet當頁面控制器)代碼如下: if ( session.getAttribute("userInfo")==null ) { response.sendRedirect(request.getServletContext.getPath() + "/login.jsp"); } else { request.getRequestDispatcher("/正常頁面.jsp").forward(request,response); }

⑷ Android如何實現類似於QQ登錄的界面,求大神!

首先程序進入SplashActivity,就是啟動頁面。
xml布局文件就是一個全屏的圖片,要注意的是設置android:scaleType ="matrix"這個屬性。不然不會全屏。
過1秒之後轉入登陸頁面,從圖片我們可以看出,騰訊的UI做的還是相當美觀漂亮的,既簡潔又不失美觀。先分析一下這個登錄界面,從整體可以看出,根布局的
背景色是藍色的,而那個QQ Android其實是一個圖片背景色和根布局的背景色一樣,這樣就不會有視覺偏差。

⑸ 如何設計android的登錄界面

在網上在到一個登錄界面感覺挺不錯的,給大家分享一下~先看效果圖:

這個Demo除了按鈕、小貓和Logo是圖片素材之外,其餘的UI都是通過代碼實現的。

?

一、背景

背景藍色漸變,是通過一個xml文件來設置的。代碼如下:

background_login.xml

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:andro>
<gradient
android:startColor="#FFACDAE5"
android:endColor="#FF72CAE1"
android:angle="45"
/>
</shape>


startColor是漸變開始的顏色值,endColor是漸變結束的顏色值,angle是漸變的角度。其中#FFACDAE5中,FF是Alpha值,AC是RGB的R值,DA是RGB的G值,E5是RGB的B值,每個值在00~FF取值,即透明度、紅、綠、藍有0~255的分值,像要設置具體的顏色,可以在PS上的取色器上查看設置。

?

?

二、圓角白框

效果圖上面的並不是白框,其實框是白色的,只是設置了透明值,也是靠一個xml文件實現的。

background_login_div.xml

<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:andro>
<solid android:color="#55FFFFFF" />
<!-- 設置圓角
注意: bottomRightRadius是左下角而不是右下角 bottomLeftRadius右下角-->
<corners android:topLeftRadius="10dp" android:topRightRadius="10dp"
android:bottomRightRadius="10dp" android:bottomLeftRadius="10dp"/>
</shape>

?

三、界面的布局

界面的布局挺簡單的,就直接貼代碼啦~

login.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:andro
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:
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="15dip"
android:layout_margin="15dip"
android:background="@drawable/background_login_div_bg" >
<!-- 賬號 -->
<TextView
android:
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginTop="5dp"
android:text="@string/login_label_username"
/>
<EditText
android:
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="@string/login_username_hint"
android:layout_below="@id/login_user_input"
android:singleLine="true"
android:inputType="text"/>
<!-- 密碼 text -->
<TextView
android:
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/username_edit"
android:layout_marginTop="3dp"
android:text="@string/login_label_password"
/>
<EditText
android:
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/login_password_input"
android:password="true"
android:singleLine="true"
android:inputType="textPassword" />
<!-- 登錄button -->
<Button
android:
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/password_edit"
android:layout_alignRight="@id/password_edit"
android:text="@string/login_label_signin"
android:background="@drawable/blue_button" />
</RelativeLayout>

<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<TextView android:
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" />
<ImageView android:
android:src="@drawable/cat"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:layout_marginRight="25dp"
android:layout_marginLeft="10dp"
android:layout_marginBottom="25dp" />
<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"/>
</RelativeLayout>
</LinearLayout>

⑹ 求一個登錄界面的Android的代碼,很簡單的那種,兩個輸入框和一個確認鍵就行了,其他的什麼都不要

你直接在android studio中new activity的時候選擇loginActivity即可, 默認會創建一個示例的登錄界面, 輸入框, 登錄按鈕都有了

⑺ android登錄問題

創建一個全局變數,標記你是否已經登錄。每次點擊的時候做判斷,已經登錄了就不彈登錄界面了。

⑻ android登錄,當網路連接時登錄按鈕可用,網路沒有連接時登錄按鈕不可用。急。

ConnectivityManager conManager= (ConnectivityManager)context.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo activeNetworkInfo = conManager.getActiveNetworkInfo();
boolean isConnected = activeNetworkInfo.isConnected();

這code應該可以判斷網路是否可以用

⑼ 如何使用Android Studio開發用戶登錄界面

⑽ Android登錄成功以後,在個人中心界面顯示登錄時的用戶名圖片2登陸成功後獲得用戶名和賬號,怎

摘要 1、從布局中取得用戶名和密碼

閱讀全文

與android登錄按鈕相關的資料

熱點內容
免費pdf工具 瀏覽:380
pdf加密一機一碼 瀏覽:600
怎麼把百度雲資源壓縮 瀏覽:456
不會數學英語如何編程 瀏覽:88
如何能知道網站伺服器地址 瀏覽:648
程序員月薪5萬難嗎 瀏覽:138
如何評價程序員 瀏覽:803
雲虛機和伺服器的區別 瀏覽:403
廣西柳州壓縮機廠 瀏覽:639
arm開發編譯器 瀏覽:833
51單片機的核心 瀏覽:746
看電視直播是哪個app 瀏覽:958
將c源程序編譯成目標文件 瀏覽:787
再要你命3000pdf 瀏覽:558
ai軟體解壓軟體怎麼解壓 瀏覽:520
文件夾怎樣設置序列號 瀏覽:963
javascriptgzip壓縮 瀏覽:248
易語言怎麼取出文件夾 瀏覽:819
蘋果xs手機加密app哪裡設置 瀏覽:605
超聲霧化器與壓縮霧化器 瀏覽:643