[英]Set android window title bar icon from custom application theme
Is it possible to set the window title bar title and icon from my own custom theme? 是否可以通过我自己的自定义主题设置窗口标题栏标题和图标? when i create a new Android project in eclipse and have it use AppTheme as shown here
当我在eclipse中创建一个新的Android项目并使用AppTheme时,如下所示
<style name="AppTheme" parent="android:Theme.Light" />
the window title bar title and icon appear as i want them. 窗口标题栏标题和图标如我所愿出现。
When i select my own theme in the mainfest file only the title shows in the window title bar and not the icon. 当我在mainfest文件中选择自己的主题时,仅标题显示在窗口标题栏中,而不显示图标。
My theme is as follows 我的主题如下
style name="GenericWallpaper" parent="android:Theme.Light"
item name="android:windowBackground">@drawable/blackbackground
item name="android:layout_width">fill_parent
item name="android:layout_height">fill_parent
I would rather use my xml style file to specify the icon and title are required than having to set it programatically in the window title bar in every activity. 我宁愿使用我的xml样式文件来指定所需的图标和标题,而不是必须在每个活动的窗口标题栏中以编程方式进行设置。
I am using android:minSdkVersion="8"
, android:targetSdkVersion="15"
我正在使用
android:minSdkVersion="8"
, android:targetSdkVersion="15"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.