2014-10-07 24 views

回答

2

只需设置你的自定义布局的ImageView和TextView的ID和特别活动动态地设置其值为

ImageView image=(Imageview)getWindow().findViewById(your image view id); 
TextView title=(Textview)getWindow().findViewById(your image view id); 

设置image.setImageResource(...);title.settext(title);

完蛋了....

+0

谢谢!这对我真的很有帮助! :) – 2014-10-07 12:10:44

2

而不是将您的应用程序标记上的主题改为您的活动。例如:

 <activity 
     android:theme="@style/themeForAcitivy" 
     android:name="MyActivity"> 
     </activity> 

您也可以拨打getActionBar().setCustomView(R.layout.myCustomBar)每个活动以创建自定义视图的ActionBar如果太为你工作。