androidedittext圖片
❶ android EditText輸入文字 數字時 裡面的圖片文字怎麼消失 用的是哪個屬性
你說的是在EditText有個水印,輸入的時候水印消失的效果吧?你再EditText的XML中加入android:hint=「請輸入用戶名」,運行時EditText就會有一個「請輸入用戶名」的水印,當你輸入任何字元時,水印消失,刪除所有字元後水印又會出來,你還可以用android:textColorHint="顏色值"來設置水印文字的顏色哦。在java代碼中可以使用對應的方法實現這些功能,分別是
setHint(水印文字)和setHintTextColor(顏色值)
❷ 安卓如何實現圖中可以輸入文字又可以插入圖片的功能
圖片如果不確定張數的話,最好還是動態插入式的實現比較好。比如在EditText下放一個LinearLayout,在代碼里,每添加一張圖片就使用LinearLayout.addView(ImageView);添加一個。
如果圖片就只有一張的話,那麼就是EditText+ImageView就可以了。
❸ android開發中EditText中動態添加別的控制項(圖片,按鈕,視頻)
Android
Edittext
添加按鈕
android開發EditText中添加圖片
----------------------同志你好,我是CSDN問答機器人小N,奉組織之命為你提供參考答案,編程尚未成功,同志仍需努力!
❹ android如何實現EditText中添加ImgeButton
<RelativeLayout
android:layout_marginTop="30dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<EditText
android:id="@+id/login_password"
android:layout_width="fill_parent"
android:layout_height="40dp"
android:hint="請輸入密碼"
android:password="true"
android:textAppearance="?android:attr/textAppearanceMedium"
android:singleLine="true"
android:ellipsize="end"
android:paddingRight="5dp"/>
<ImageButton
android:id="@+id/see_password"
android:layout_width="40dp"
android:layout_height="25dp"
android:background="@drawable/eyes"
android:layout_margin="10dp"
android:layout_alignRight="@id/login_password"
/>
</RelativeLayout>
❺ 如何得到android EditText裡面的字元串
Android中有許多寫法創建事件處理方式,一般會使用Android:onClick屬性來指定。
舉例說明:
實現攝氏溫度到華氏溫度的轉變
1、
EditText editText1 =(EditText) findViewById (R.id.editText1)
c=Integer.parseInt(editText1.getText().toString());
用來獲取editText1中的信息
2、
EditText editText2 =(EditText) findViewById (R.id.editText2);
f=(9.0*c)/5.0+32.0;
editText2.setText(String.valueOf(f));
通過editText1 獲取的信息然後經過計算
將計算的結果返回editText2中然後在editText2中顯示出來
(5)androidedittext圖片擴展閱讀:
EditText 控制項的用法
EditText 在開發中也是經常用到的控制項,也是一個比較必要的組件。
它是用戶跟Android應用進行數據傳輸的窗戶。
1、android:text設置文本內容。
2、android:textColor字體顏色。
3、android:hint內容為空時候顯示的文本。
4、android:textColorHint為空時顯示的文本的顏色。
5、android:maxLength限制顯示的文本長度,超出部分不顯示。
6、android:minLines設置文本的最小行數。
7、android:gravity設置文本位置,如設置成「center」,文本將居中顯示。
8、android:drawableLeft在text的左邊輸出一個drawable,如圖片。
❻ android Material主題 EditText 這種效果[圖]
用TextInputLayout這個控制項即可,比如:
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="50dp">
<EditText
android:id="@+id/et_password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="請輸入密碼"
android:inputType="text"
android:maxLines="1"
android:singleLine="true"/>
</android.support.design.widget.TextInputLayout>
❼ 請教達人,Android添加背景圖片後,EditText中輸入的文字變淡,該如何解決
這個是背景圖片的問題,當兩者的亮度沖突會導致這樣子的。。
❽ 有沒有哪位大神有android edittext 的那框的背景圖片 因為在android 4.0 這框只顯示一半
android:background="@android:drawable/editbox_background"
背景那裡直接這樣寫就OK了
@android:drawable/editbox_background
是系統提供的2.2黃色的那個編輯框背景
不需要自己找那個圖片
❾ android Eclipse 怎麼在edittext 中添加image view 下面圖片 求XML 格式代碼
在java代碼裡面setText(Html.fromHtml("你要填的html代碼"));
❿ android開發: EditText中插入的相冊圖片如何保存在資料庫里,查看的時候又如何讀取
保存一個url是個不錯的方法,然後載入的時候就可以根據路徑去生成一個bitmap對象,再把這個對象顯示到組件上 。如果知道路徑,那麼顯示時調用BitmapFactory.decodeFile(String pathName)這個方法就行,參數為一個路徑字元串.