zoukankan      html  css  js  c++  java
  • 自定义Activity的标题栏

    MyActivity.java 
    Java代码 复制代码
    1. requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);     
    2. setContentView(R.layout.main);            
    3. getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.title);     
    4. TextView titleTV = (TextView)findViewById(R.id.title);     
    5. titleTV.setText(R.string.app_name);   

    title.xml
    Java代码 复制代码
    1. <?xml version="1.0" encoding="UTF-8"?>   
    2. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"        
    3. android:orientation="horizontal"       
    4. android:layout_width="fill_parent"        
    5. android:layout_height="fill_parent"     >       
    6. <TextView            
    7. android:id="@+id/title"            
    8. android:layout_width="wrap_content"            
    9. android:layout_height="wrap_content"            
    10. android:layout_weight="1"            
    11. android:layout_gravity="center"            
    12. android:gravity="center" />   
    13. </LinearLayout>  
  • 相关阅读:
    MySQL 卸载
    Mysql(压缩包)下载与安装
    sqlserver一次性修改多条
    mysql一些操作
    SQL函数集合
    js时间转换相关
    easyui grid中翻页多选方法
    easyui combobox筛选(拼音)
    wpf图片切换,幻灯效果
    openfire搭建IM
  • 原文地址:https://www.cnblogs.com/tt_mc/p/1709015.html
Copyright © 2011-2022 走看看