Android include 標籤注意點

http://www.cnblogs.com/top5/archive/2012/05/07/2486909.htmlhtml

http://www.eoeandroid.com/thread-273456-1-1.html android

問題引出 :上面兩個連接佈局

問題解決:spa

 <includehtm

        android:id="@id/include_head2"blog

        android:layout_width="match_parent"get

        android:layout_height="60dp"string

        layout="@layout/head_view2" />it

@ViewInject(R.id.back_button)thread

private Button back_button;//返回

@ViewInject(R.id.title_textview)

private TextView title_textview;// 標題欄

@ViewInject(R.id.include_head2)

private RelativeLayout include_head2;// 標題欄根佈局            注意這裏並非<include>根佈局的id,是這個標籤的id

title_textview.setText(R.string.title_suggest);

include_head2.setBackgroundResource(R.drawable.color_title_white_trans); //這裏就覆蓋了<include>根佈局的背景

相關文章
相關標籤/搜索