如题。
类似微信的这种UI。
有的粘下。
刚刚接触。
谢谢。。
解决方案 »
- 把应用push到/system/app下面后,加载.so库的问题
- android 蓝牙游戏 数据传递
- 关于Activity全屏显示问题!!!
- android任务管理器demo(12项功能)
- 谁能给我讲一下android里的atts 谢谢了,这是自定义是属性还是系统属性?
- 关于AutoCompleteTextView使用数据库的问题
- 希望能碰到高手 百度地图 覆盖层 无法刷新 无法显示 (就这些分了)
- 很想知道,自己汉化的安卓应用能否在这里发布
- 垂直自动滚动问题(第一行固定,其他行自动滚动)有人知道怎么实现吗?
- AndroidStudio启动和编译的时候CPU使用率很高导致闪退
- 下载Android源代码遇到curl: (52) Empty reply from server,为什么
- 关于RIL层的问题
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.view.Window;
import android.widget.TabHost;
import android.widget.TabHost.TabSpec;public class TabBottomActivity extends TabActivity { @Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.tabview); TabHost tabHost = getTabHost();
TabView view = null; // 音乐包
view = new TabView(this, R.drawable.yyb, R.drawable.yyb_sel);
view.setBackgroundColor(Color.WHITE);
TabSpec spec1 = tabHost.newTabSpec("Music");
spec1.setIndicator(view);
Intent musicIntent = new Intent(this, MyMusicActivity.class);
spec1.setContent(musicIntent); // 本地
view = new TabView(this, R.drawable.local, R.drawable.local_sel);
view.setBackgroundColor(Color.WHITE);
TabSpec spec2 = tabHost.newTabSpec("Local");
spec2.setIndicator(view);
Intent localIntent = new Intent(this, LocalActivity.class);
spec2.setContent(localIntent); // 收藏
view = new TabView(this, R.drawable.fav, R.drawable.fav_sel);
view.setBackgroundColor(Color.WHITE);
TabSpec spec3 = tabHost.newTabSpec("Fav");
spec3.setIndicator(view);
Intent favIntent = new Intent(this, FavActivity.class);
spec3.setContent(favIntent); // 搜索
view = new TabView(this, R.drawable.search, R.drawable.search_sel);
view.setBackgroundColor(Color.WHITE);
TabSpec spec4 = tabHost.newTabSpec("Search");
spec4.setIndicator(view);
Intent searchIntent = new Intent(this, SearchActivity.class);
spec4.setContent(searchIntent); tabHost.addTab(spec1);
tabHost.addTab(spec2);
tabHost.addTab(spec3);
tabHost.addTab(spec4);
tabHost.setCurrentTab(0);
}}
然后是:tabview.xml
<?xml version="1.0" encoding="utf-8"?>
<TabHost android:layout_width="fill_parent" android:background="@drawable/bg"
android:layout_height="fill_parent" android:id="@android:id/tabhost"
xmlns:android="http://schemas.android.com/apk/res/android">
<RelativeLayout android:layout_width="fill_parent"
android:layout_height="fill_parent" android:orientation="vertical"
android:padding="3dp">
<FrameLayout android:layout_width="fill_parent"
android:layout_height="fill_parent" android:id="@android:id/tabcontent"
android:layout_weight="1">
</FrameLayout>
<TabWidget android:layout_width="fill_parent"
android:layout_height="50dip" android:id="@android:id/tabs"
android:layout_alignBottom="@android:id/tabcontent" />
</RelativeLayout>
</TabHost> 最后是:MyMusicActivity
import android.app.Activity;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.LinearLayout;
import android.widget.ListView;public class MyMusicActivity extends Activity {
ListView listView; @Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
listView = new ListView(this);
listView.setAdapter(new BaseAdapter() { @Override
public View getView(int position, View convertView, ViewGroup parent) {
LayoutInflater inflater = getLayoutInflater();
LinearLayout layout = (LinearLayout) inflater.inflate(
R.layout.music, null);
return layout;
} @Override
public long getItemId(int position) {
return 0;
} @Override
public Object getItem(int position) {
return null;
} @Override
public int getCount() {
return 5;
}
});
setContentView(listView);
}}FavActivity\SearchActivity\LocalActivity,自己去定义好了
listView http://blog.csdn.net/xiaominghimi/article/details/6314704