App>Activity>CustomTitle
这里出现了一个定制title,就是给一个activity在状态栏下,布局上定制一个布局
requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
setContentView(R.layout.custom_title);
getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.custom_title_1);
final TextView leftText = (TextView) findViewById(R.id.left_text);
final TextView rightText = (TextView) findViewById(R.id.right_text);
布局上的组件也是通过fandviewbyid获取对象的。
本文介绍如何在Android应用中为Activity自定义标题布局,包括使用requestWindowFeature设置自定义标题、加载特定布局文件及通过findViewById获取布局组件的方法。
1775

被折叠的 条评论
为什么被折叠?



