我有一个调查类型的表单,它会在用户按下submit之后显示一个响应。这是使用webview客户端,因此我可以在覆盖URL之前轻松地修改CSS。但是,在按下submit后,样式将显示为黑色字体(以及其他不需要的字体)。有没有办法改变WebTextView的文本颜色?
最终,最好覆盖它,但看起来我不能:
WebTextView(Context context, WebView webView, int autoFillQueryId) { super(context, null, com.android.internal.R.attr.webTextViewStyle);
mWebView = webView;
mMaxLength = -1;
setAutoFillable(autoFillQueryId);
// Turn on subpixel text, and turn off kerning, so it better matches
// the text in webkit.
TextPaint paint = getPaint();
int flags = paint.getFlags() & ~Paint.DEV_KERN_TEXT_FLAG
| Paint.SUBPIXEL_TEXT_FLAG | Paint.DITHER_FLAG;
paint.setFlags(flags);
// Set the text color to black, regardless of the theme. This ensures
// that other applications that use embedded WebViews will properly
// display the text in password textfields.
setTextColor(DebugFlags.DRAW_WEBTEXTVIEW ? Color.RED : Color.BLACK);发布于 2013-02-26 05:07:03
有没有办法改变WebTextView的文本颜色?
Android SDK中没有WebTextView,因此无法修改。
这是使用webview客户端,所以我可以在覆盖
之前很容易地修改CSS。
听起来你的问题是CSS最初应该是正确的,无论是提交表单前显示的页面还是提交后显示的页面。实际上,解决方案是从HTML/CSS/JS的角度出发,由您(可能)控制。
https://stackoverflow.com/questions/15076190
复制相似问题