初始化viewtitle类

来源:互联网 发布:保温隔热材料知乎 编辑:程序博客网 时间:2024/05/21 15:44
private ViewTitle viewTitle;

 

private void initView() {
        viewTitle = (ViewTitle) findViewById(R.id.title_bar);
        timeStart = (TextView) findViewById(R.id.tv_choose_time_start);
        timeStop = (TextView) findViewById(R.id.tv_choose_time_stop);
        province = (TextView) findViewById(R.id.tv_province);
        city =(TextView) findViewById(R.id.tv_city);
        districttv = (TextView) findViewById(R.id.tv_district);
        allIncome = (TextView) findViewById(R.id.tv_all_income);//累计收益
       
tv_ChargingEarn = (TextView) findViewById(R.id.tv_ChargingEarn);//充电收益
       
tv_Dividends = (TextView) findViewById(R.id.tv_Dividends);//分红收益
       
tv_ResultsEarn= (TextView) findViewById(R.id.tv_ResultsEarn);//业绩收益
       
chooseRegion = (LinearLayout) findViewById(R.id.ll_choose_region);
        viewTitle.setZhongJianText("收益明细");
//        tv_left = viewTitle.getZuobianTextView();
       
viewTitle.getZuobianView().setVisibility(View.VISIBLE);
       // tv_right.setText("保存");
//        tv_left.setOnClickListener(newView.OnClickListener() {
//
//            @Override
//            public void onClick(Viewarg0) {
//                finish();
//            }
//        });
   
}

switch (view.getId()) {    case R.id.title_bar:        finish();        break;

.xml

<com.bluesky.mainplie.widget.ViewTitle    android:id="@+id/title_bar"    android:layout_width="match_parent"    android:layout_height="wrap_content"    android:layout_marginTop="12dp"/>
0 0