Android開発ソフトキーボードのログインボタンをブロックする完璧なソリューション
アプリケーションのログインページで、ユーザー名とパスワードを入力する必要があります。この情報を入力すると、ソフト キーボードがログイン ボタンをブロックし、ユーザー エクスペリエンスが低下します。そのため、今日この問題を解決しましょう
1: ログイン レイアウト インターフェイスは次のとおりです
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/login_bg" > <LinearLayout android:id="@+id/ll_center" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical" > <ScrollView android:id="@+id/sl_center" android:layout_width="fill_parent" android:layout_height="0dp" android:layout_weight="1" android:fadingEdge="none" android:scrollbars="none" > <RelativeLayout android:id="@+id/rl_center" android:layout_width="fill_parent" android:layout_height="wrap_content" > <LinearLayout android:id="@+id/sms_login_ll_title" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerHorizontal="true" android:layout_marginTop="90dip" android:orientation="horizontal" > <ImageView android:id="@+id/sms_login_iv_icon" android:layout_width="70dip" android:layout_height="70dip" android:layout_gravity="center_vertical" android:src="@drawable/login_top_icon" /> <ImageView android:id="@+id/sms_login_iv_big_text" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:layout_marginLeft="15dip" android:src="@drawable/sms_login_icon_big" /> </LinearLayout> <ImageView android:id="@+id/sms_login_iv_name" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@id/sms_login_ll_title" android:layout_centerHorizontal="true" android:layout_marginTop="28dip" android:background="@drawable/sms_login_icon_small" /> <RelativeLayout android:id="@+id/sms_login_rl_input_name" android:layout_width="fill_parent" android:layout_height="43dip" android:layout_below="@id/sms_login_iv_name" android:layout_centerHorizontal="true" android:layout_marginLeft="40dip" android:layout_marginRight="40dip" android:layout_marginTop="40dip" android:background="@drawable/login_top_input" > <ImageView android:id="@+id/sms_login_iv_input_name_icon" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_centerVertical="true" android:layout_marginLeft="10dip" android:layout_marginRight="10dip" android:background="@drawable/login_input_icon_user" /> <FrameLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_centerVertical="true" android:layout_toRightOf="@id/sms_login_iv_input_name_icon" > <EditText android:id="@+id/sms_login_et_accout" android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="@drawable/transparent_white" android:digits="@string/sms_login_accout_text" android:hint="请输入账号" android:singleLine="true" android:text="" android:textSize="20sp" /> </FrameLayout> </RelativeLayout> <RelativeLayout android:id="@+id/sms_login_rl_input_pass" android:layout_width="fill_parent" android:layout_height="43dip" android:layout_below="@id/sms_login_rl_input_name" android:layout_centerHorizontal="true" android:layout_marginLeft="40dip" android:layout_marginRight="40dip" android:background="@drawable/login_top_input" > <ImageView android:id="@+id/sms_login_iv_input_pass_icon" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_centerVertical="true" android:layout_marginLeft="10dip" android:layout_marginRight="10dip" android:background="@drawable/login_input_icon_pwd" /> <FrameLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_centerVertical="true" android:layout_toRightOf="@id/sms_login_iv_input_pass_icon" > <EditText android:id="@+id/sms_login_et_password" android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="@drawable/transparent_white" android:digits="@string/sms_et_change_password_old_text" android:hint="请输入密码" android:inputType="textPassword" android:singleLine="true" android:text="" android:textSize="20sp" /> </FrameLayout> </RelativeLayout> </RelativeLayout> </ScrollView> <Button android:id="@+id/sms_login_bt_confirm" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_below="@id/sms_login_rl_input_pass" android:layout_centerHorizontal="true" android:layout_marginLeft="40dip" android:layout_marginRight="40dip" android:layout_marginTop="16dip" android:background="@drawable/sms_update_pass_bg_selector" android:text="登 录" android:textColor="@color/white" android:textSize="20sp" /> </LinearLayout> </RelativeLayout>
注意すべき点は次のとおりです:
1: 階層関係
RelativeLayout-----
LinearLayout----
ScrollView,
Button
2: AndroidManifest.xml のアクティビティ構成 Android:windowSoftInputMode="stateHidden|adjustResize"
3 : 以下のコードを参照してください
etAccount = (EditText) this.findViewById(R.id.sms_login_et_accout); etAccount.setOnClickListener(this); etAccount.setOnTouchListener(new OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { changeScrollView(); return false; } }); /** * 使ScrollView指向底部 */ private void changeScrollView(){ h.postDelayed(new Runnable() { @Override public void run() { sl_center.scrollTo(0, sl_center.getHeight()); } }, 300); } Handler h = new Handler(){ public void handleMessage(Message msg) { }; };
上記は、エディターによって導入されたログイン ボタンをカバーする Android 開発ソフト キーボードの完璧なソリューションです。ご質問があれば、メッセージを残してください。編集者が時間内に返信します。また、PHP 中国語 Web サイトをサポートしていただきありがとうございます。
Android 開発ソフト キーボードでログイン ボタンをブロックするための完璧なソリューションに関するその他の関連記事については、PHP 中国語 Web サイトに注目してください。

ホットAIツール

Undresser.AI Undress
リアルなヌード写真を作成する AI 搭載アプリ

AI Clothes Remover
写真から衣服を削除するオンライン AI ツール。

Undress AI Tool
脱衣画像を無料で

Clothoff.io
AI衣類リムーバー

AI Hentai Generator
AIヘンタイを無料で生成します。

人気の記事

ホットツール

メモ帳++7.3.1
使いやすく無料のコードエディター

SublimeText3 中国語版
中国語版、とても使いやすい

ゼンドスタジオ 13.0.1
強力な PHP 統合開発環境

ドリームウィーバー CS6
ビジュアル Web 開発ツール

SublimeText3 Mac版
神レベルのコード編集ソフト(SublimeText3)

ホットトピック









Javaのクラスロードには、ブートストラップ、拡張機能、およびアプリケーションクラスローダーを備えた階層システムを使用して、クラスの読み込み、リンク、および初期化が含まれます。親の委任モデルは、コアクラスが最初にロードされ、カスタムクラスのLOAに影響を与えることを保証します

この記事では、カフェインとグアバキャッシュを使用してJavaでマルチレベルキャッシュを実装してアプリケーションのパフォーマンスを向上させています。セットアップ、統合、パフォーマンスの利点をカバーし、構成と立ち退きポリシー管理Best Pra

この記事では、キャッシュや怠zyなロードなどの高度な機能を備えたオブジェクトリレーショナルマッピングにJPAを使用することについて説明します。潜在的な落とし穴を強調しながら、パフォーマンスを最適化するためのセットアップ、エンティティマッピング、およびベストプラクティスをカバーしています。[159文字]

この記事では、Javaプロジェクト管理、自動化の構築、依存関係の解像度にMavenとGradleを使用して、アプローチと最適化戦略を比較して説明します。

この記事では、MavenやGradleなどのツールを使用して、適切なバージョン化と依存関係管理を使用して、カスタムJavaライブラリ(JARファイル)の作成と使用について説明します。
