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

android EditText 融入背景

android EditText blends into background(android EditText 融入背景)
本文介紹了android EditText 融入背景的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

問(wèn)題描述

限時(shí)送ChatGPT賬號(hào)..

我的應(yīng)用使用 Theme.Holo.Light.DarkActionBar 作為父主題.

My app uses Theme.Holo.Light.DarkActionBar as the parent theme.

當(dāng)我使用我的 Android 3.2 平板電腦模擬器時(shí),幾乎看不到 EditText 形狀.看起來(lái)它正在嘗試在白色上繪制白色.在這里看到:

When I use my Android 3.2 tablet emulator, the EditText shape is almost impossible to see. It looks like it is trying to draw white on white. Seen here:

當(dāng)我在我的 Android 4.0 平板電腦模擬器上使用它時(shí),EditText 形狀看起來(lái)還不錯(cuò).您可以看到沿 EditText 底部的深灰色線.如果您查看上圖,您將在與淺灰色背景水印相交的同一位置幾乎看不到一條白線.

When I use it on my Android 4.0 tablet emulator, the EditText shape looks just fine. You can see the dark grey line along the bottom of the EditText. If you look in the above image, you'll just barely see a white line in the same place as it crosses the light grey background watermark.

這是我在布局中的 EditText:

Here is my EditText in the layout:

<EditText
    android:id="@+id/fieldName"
    style="@style/PlayerDetails.Field"
    android:capitalize="words" />

風(fēng)格如下:

<style name="PlayerDetails.Field">
    <item name="android:layout_weight">0.65</item>
    <item name="android:paddingLeft">10dp</item>
    <item name="android:layout_width">0dp</item>
    <item name="android:layout_height">fill_parent</item>
    <item name="android:layout_marginLeft">10dp</item>
</style>

為什么我的 EditText 繪制的顏色錯(cuò)誤?我沒(méi)有覆蓋繪圖代碼或背景可繪制對(duì)象.

Why is my EditText getting drawn the wrong color? I'm not overriding the drawing code or the background drawable.

推薦答案

其他答案實(shí)際上并不能解決我的問(wèn)題,我從未弄清楚是什么真正導(dǎo)致了問(wèn)題.然而,這就是我解決它的方法:我的解決方法是從 Ice Cream Sandwich 復(fù)制 EditText 小部件的 .9.pngs 和樣式,然后硬編碼到我的 Honeycomb 和 Ice Cream Sandwich 應(yīng)用程序中.

The other answers weren't actually solutions to my problem and I never figured out what was REALLY causing the issue. However, this is how I solved it: My workaround was to copy the .9.pngs and styling for the EditText widget from Ice Cream Sandwich and hardcoded into my app for Honeycomb and Ice Cream Sandwich.

我創(chuàng)建了一個(gè)名為 res/drawable-nodpi/edit_text_holo_light.xml 的文件,其中包含以下內(nèi)容:

I created a file called res/drawable-nodpi/edit_text_holo_light.xml with the following:

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">

    <item android:state_multiline="true" android:state_window_focused="false" android:state_enabled="true"  android:drawable="@drawable/textfield_multiline_default_holo_light" />
    <item android:state_multiline="true" android:state_window_focused="false" android:state_enabled="false" android:drawable="@drawable/textfield_multiline_disabled_holo_light" />
    <item android:state_multiline="true" android:state_enabled="true" android:state_focused="true" android:drawable="@drawable/textfield_multiline_activated_holo_light" />
    <item android:state_multiline="true" android:state_enabled="true" android:state_activated="true" android:drawable="@drawable/textfield_multiline_focused_holo_light" />
    <item android:state_multiline="true" android:state_enabled="true" android:drawable="@drawable/textfield_multiline_default_holo_light" />
    <item android:state_multiline="true" android:state_focused="true" android:drawable="@drawable/textfield_multiline_disabled_focused_holo_light" />
    <item android:state_multiline="true" android:drawable="@drawable/textfield_multiline_disabled_holo_light" />

    <item android:state_window_focused="false" android:state_enabled="true" android:drawable="@drawable/textfield_default_holo_light" />
    <item android:state_window_focused="false" android:state_enabled="false" android:drawable="@drawable/textfield_disabled_holo_light" />
    <item android:state_enabled="true" android:state_focused="true" android:drawable="@drawable/textfield_activated_holo_light" />
    <iten android:state_enabled="true" android:state_activated="true" android:drawable="@drawable/textfield_focused_holo_light" />
    <item android:state_enabled="true" android:drawable="@drawable/textfield_default_holo_light" />
    <item android:state_focused="true" android:drawable="@drawable/textfield_disabled_focused_holo_light" />
    <item android:drawable="@drawable/textfield_disabled_holo_light" />
</selector>

然后我在我的styles.xml中創(chuàng)建了一個(gè)樣式來(lái)設(shè)置:

Then I created a style in my styles.xml to set:

<item name="android:background">@drawable/edit_text_holo_light</item>

然后我從 android sdk 中復(fù)制了 .9.png 文件并將它們放入 res/drawable-* 中.文件名列在上面的 xml 中.

Then I copied the .9.png files from the android sdk and put them in res/drawable-*. The filenames are listed in the above xml.

這篇關(guān)于android EditText 融入背景的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

相關(guān)文檔推薦

Cut, copy, paste in android(在android中剪切、復(fù)制、粘貼)
Change Line Color of EditText - Android(更改 EditText 的線條顏色 - Android)
EditText showing numbers with 2 decimals at all times(EditText 始終顯示帶 2 位小數(shù)的數(shù)字)
Changing where cursor starts in an expanded EditText(更改光標(biāo)在展開(kāi)的 EditText 中的開(kāi)始位置)
EditText, adjustPan, ScrollView issue in android(android中的EditText,adjustPan,ScrollView問(wèn)題)
Autosizing EditText(自動(dòng)調(diào)整 EditText)
主站蜘蛛池模板: 看片网站在线 | 成人精品久久 | 伊人网在线播放 | 密室大逃脱第六季大神版在线观看 | 亚洲国产精品激情在线观看 | 四虎影院新地址 | 国产 欧美 日韩 一区 | 久久欧美高清二区三区 | 美女黄网站视频免费 | 7777精品伊人久久精品影视 | 日日操日日舔 | 国产精品久久久 | 精品精品 | 国产一区二区三区久久 | 国产精品中文字幕在线播放 | 日韩在线 | 亚洲精品国产一区 | 99re热精品视频国产免费 | 成人精品毛片 | 国产精品精品视频一区二区三区 | 黄视频免费在线 | 日韩欧美专区 | 亚洲精品一二三区 | 激情毛片 | 久久久精彩视频 | 国产精品久久久久久久免费大片 | 日本视频免费 | 欧美日韩综合精品 | 亚洲精选一区 | 国产小视频在线 | 欧美日韩一区在线播放 | 99精品欧美一区二区三区 | 色婷婷久久久久swag精品 | 午夜精品久久久久久久久久久久 | 国产精品99久久久久久www | 国产一区二区久久 | 浮生影院免费观看中文版 | 欧美一区二区三区久久精品 | 精品国产乱码久久久久久闺蜜 | 国产精品日韩欧美一区二区 | 亚洲国产欧美日韩 |