編輯:關於Android編程

<frameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
</frameLayout>package com.rainsong.tabdemo;
import android.app.TabActivity;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.widget.TabHost;
public class MainActivity extends TabActivity
{
TabHost mTabHost;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
mTabHost = getTabHost();
LayoutInflater.from(this).inflate(R.layout.tab,
mTabHost.getTabContentView(), true);
mTabHost.addTab(mTabHost.newTabSpec("tab1").setIndicator("Tab1")
.setContent(R.id.view1));
mTabHost.addTab(mTabHost.newTabSpec("tab3").setIndicator("Tab2")
.setContent(R.id.view2));
mTabHost.addTab(mTabHost.newTabSpec("tab3").setIndicator("Tab3")
.setContent(R.id.view3));
}
}
Class Overview
Container for a tabbed window view. This object holds two children: a set of tab labels that the user clicks to select a specific tab, and a FrameLayout object that displays the contents of that page.
Specify the id of the view that should be used as the content of the tab.
Android線程實現圖片輪播
一、實現效果本篇文章實現了簡單的圖片輪播,初始化3張資源圖片,初始化3秒更換一次圖片背景,輪換播放。二、知識點Thread線程start() 、sleep();handl
Android 異步任務:AsyncTask機制 源碼詳細版解析
相信大家對AsyncTask機制都不陌生?基本的使用的方法和注意事項都清楚,編寫一個類,繼承AsyncTask類,必須重寫doInBackground()方法,運行在子線
Android WaveView實現水流波動效果
水流波動的波形都是三角波,曲線是正余弦曲線,但是Android中沒有提供繪制正余弦曲線的API,好在Path類有個繪制貝塞爾曲線的方法
Android 透明式系統欄設計
一:概述Android4.4以及Android5.0之後,Android上很多APP都出現了如下效果: 簡單的說就是狀態欄顏色出現了變化,能夠跟APP界面顏色相