久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

如何更改默認 EditText 的樣式

How to change style of a default EditText(如何更改默認 EditText 的樣式)
本文介紹了如何更改默認 EditText 的樣式的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我正在使用這樣的代碼在我的 xml 文件中創建三個 EditText:

I am creating three EditTexts in my xml file using code like this:

<EditText
    android:id="@+id/name_edit_text"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_below="@+id/profile_image_view_layout"
    android:layout_centerHorizontal="true"
    android:layout_marginLeft="10dp"
    android:layout_marginRight="10dp"
    android:layout_marginTop="20dp"
    android:ems="15"
    android:hint="@string/name_field"
    android:inputType="text" />

當我運行應用程序時,它在我的設備上看起來像這樣:

When I run the app, it looks like this on my device:

但我希望它看起來像這樣,不使用任何背景圖片:

But I want it to look like this, without using any background image:

那怎么做呢?任何想法或建議都會有所幫助.

So how can that be done? Any ideas or suggestions will be helpful.

推薦答案

你有幾個選擇.

  1. 使用 Android 資產工作室 Android Holo 顏色生成器 生成您需要添加到應用中的資源、樣式和主題以獲得所有設備的全息外觀.

  1. Use Android assets studios Android Holo colors generator to generate the resources, styles and themes you need to add to your app to get the holo look across all devices.

使用 holo 無處不在 庫.

對全息文本字段使用 PNG,并自己將它們設置為背景圖像.您可以從 Android assets studios holo color generator 獲取圖像.您必須創建一個可繪制對象并定義正常、選定和禁用狀態.

Use the PNG for the holo text fields and set them as background images yourself. You can get the images from the Android assets studios holo color generator. You'll have to make a drawable and define the normal, selected and disabled states.

2016 年 1 月 7 日更新

這個答案現在已經過時了.Android 現在具有著色 API 和直接在控件上設置主題的能力.一個名為 materialdoc 的網站是關于如何為任何元素設置樣式或主題的一個很好的參考.

This answer is now outdated. Android has tinting API and ability to theme on controls directly now. A good reference for how to style or theme any element is a site called materialdoc.

這篇關于如何更改默認 EditText 的樣式的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

EditText: Disable Paste/Replace menu pop-up on Text Selection Handler click event(EditText:禁用文本選擇處理程序單擊事件上的粘貼/替換菜單彈出)
Multiline EditText with Done SoftInput Action Label on 2.3(2.3 上帶有完成 SoftInput 操作標簽的多行 EditText)
How to detect the swipe left or Right in Android?(如何在 Android 中檢測向左或向右滑動?)
Prevent dialog dismissal on screen rotation in Android(防止在Android中的屏幕旋轉對話框解除)
How do I handle ImeOptions#39; done button click?(如何處理 ImeOptions 的完成按鈕點擊?)
How do you set EditText to only accept numeric values in Android?(您如何將 EditText 設置為僅接受 Android 中的數值?)
主站蜘蛛池模板: 9999久久 | 国产69久久精品成人看动漫 | 国内精品久久久久久久影视简单 | 欧美涩涩网| 久久久久电影 | 国产二区三区 | 国内精品久久久久久 | 日韩精品在线播放 | 九九热在线视频免费观看 | 午夜精品一区二区三区在线视频 | 99精品视频免费观看 | 999国产精品视频免费 | 91高清视频在线观看 | 久久不卡 | 国产精品呻吟久久av凹凸 | 久久精品色欧美aⅴ一区二区 | 91在线资源 | www.久久.com | 欧美日韩免费 | 免费观看一级视频 | 精品久久久久久久久久久久 | av在线播放免费 | 久久在线看| 国产精品久久久久久久久久了 | 精品国产乱码久久久久久丨区2区 | com.国产| 欧美视频一区二区三区 | 国产精品一区二区三区四区五区 | 97精品超碰一区二区三区 | 国产精品免费一区二区 | 久久精品视频网站 | 国产成人精品一区二 | 91精品久久久久久久久99蜜臂 | 这里只有精品999 | 欧美视频偷拍 | 国产在线网站 | 国产91在线播放精品91 | 成人午夜影院 | 91精品国产91久久久久久 | 在线播放国产视频 | 国产精品一区二区不卡 |