计划使用chrome自定义选项卡,但是在我开始之前我想知道它是否可以拦截请求并在请求中设置类似于WebViews的任何标头?
阅读文档,找不到任何示例或参考.我能找到的只是onNavigationEvent回调,它告诉我们想要加载哪个url浏览器.
如果需要,还可以停止任何网址的导航吗?
我正在扩展TextView并加载自定义字体.我在列表视图中使用此自定义文本视图.当我滚动列表时,有时我得到以下调试消息
requestLayout()在布局期间由com.sample.CustomTextView {52afae4c V.ED .... ...... ID 0,27-27,44#7f060074 app:id/some_id}不正确地调用:运行第二个布局传递
public class CustomTextView extends TextView {
private FontType mFontType;
public CustomTextView(Context context, AttributeSet attrs) {
super(context, attrs, 0);
if(!isInEditMode()){
TypedArray attributesArray = context.getTheme().obtainStyledAttributes(attrs, R.styleable.CustomTextView, 0, 0);
try{
mFontType = FontType.values()[attributesArray.getInteger(R.styleable.CustomTextView_fontType, 0)];
setFontType(mFontType);
setTypeface(Cache.getCustomTypeface(mContext, LIGHT));
// Note: This flag is required for proper typeface rendering
setPaintFlags(getPaintFlags() | Paint.SUBPIXEL_TEXT_FLAG);
}finally {
attributesArray.recycle();
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
但是,如果列表视图未滚动或第一次加载时,则不会打印此警告.我需要覆盖一些东西并设置任何标志吗?