android实现底部菜单栏
2010-07-13 21:28:00 来源:WEB开发网publish.setBackgroundResource(R.drawable.tab_one_normal);
more.setBackgroundResource(R.drawable.tab_one_normal);
}
});
more = (LinearLayout) findViewById(R.id.more);
more.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
more.setBackgroundResource(R.drawable.tab_two_highlight);
linearLayout.setBackgroundResource(R.drawable.tab_one_normal);
publish.setBackgroundResource(R.drawable.tab_one_normal);
change.setBackgroundResource(R.drawable.tab_one_normal);
}
});
}
配置文件实现:
< ?xml version="1.0" encoding="utf-8"?>
< LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal" android:layout_width="fill_parent"
android:layout_height="wrap_content">
< LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="80px"
android:layout_height="wrap_content" android:id="@+id/home"
android:background="@drawable/tab_one_normal">
< TextView android:layout_width="wrap_content"
android:layout_height="wrap_content" android:text="@string/home"
android:gravity="center" android:paddingTop="29px"
android:background="@drawable/home" />
< /LinearLayout>
< ImageView android:layout_width="wrap_content"
android:layout_height="wrap_content" android:src="@drawable/line" />
< LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="80px"
android:layout_height="wrap_content" android:background="@drawable/tab_one_normal"
android:id="@+id/publish">
更多精彩
赞助商链接