Android的窗口功能问题:初始化窗口的特征序列 [英] android Window feature problem: the sequence of initializing the feature of window

查看:174
本文介绍了Android的窗口功能问题:初始化窗口的特征序列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


  1. requestWindowFeature(Window.FEATURE_LEFT_ICON);

  2. 的setContentView(R.layout.main);

  3. getWindow()setFeatureDrawableResource(Window.FEATURE_LEFT_ICON,R.drawable.icon)。

该序列arbitary,为什么?

The sequence is arbitary, why?

如果我在之前的setContentView一个initWindow()方法,把语句1和3一起,设置左图标没有效果。

If I put statement 1 and 3 together in a initWindow() method before setContentView, setting left icon has no effect.

推荐答案

那么最明显的答案是,因为它这样写的。更具体现存唯一的窗口实现,现在是<一个href=\"http://android.git.kernel.org/?p=platform/frameworks/policies/base.git;a=blob;f=phone/com/android/internal/policy/impl/PhoneWindow.java;h=5592b6d5337e83bd9cb0d94e2a131acfc3a093ec;hb=HEAD\"相对=nofollow> PhoneWindow (你可以看到这个链接源)忽略所有 setDrawable 要求安装,直到内容视图(和装饰视图)的。

Well most obvious answer is because it written this way. To be more specific only existing Window implementation for now is PhoneWindow (you can see source with this link) ignores all setDrawable calls until content view ( and decor view ) is installed.

这篇关于Android的窗口功能问题:初始化窗口的特征序列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆