android-仿QQtab(6)
来源:未知 责任编辑:责任编辑 发表时间:2014-05-20 18:32 点击:次
android:layout_centerInParent="true"
android:layout_marginLeft="15dip"
/>
</RelativeLayout>
</LinearLayout>
</RelativeLayout>
view plaincopy to clipboardprint?import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.animation.TranslateAnimation;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.RelativeLayout.LayoutParams;
import android.widget.TextView;
public class QQTabActivity extends Activity {
/** Called when the activity is first created. */
private RelativeLayout layout;
private RelativeLayout layout1;
private RelativeLayout layout2;
private RelativeLayout layout3;
private TextView text;
private ImageView tab1;
private ImageView tab2;
private ImageView tab3;
private ImageView first;
private int current = 1; // 默认选中第一个,可以动态的改变此参数值
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
initUI();
}
private void initUI(){
layout = (RelativeLayout) findViewById(R.id.root);
layout1 = (RelativeLayout) findViewById(R.id.layout1);
layout2 = (RelativeLayout) findViewById(R.id.layout2);
layout3 = (RelativeLayout) findViewById(R.id.layout3);
tab1 = (ImageView) findViewById(R.id.tab1);
tab2 = (ImageView) findViewById(R.id.tab2);
tab3 = (ImageView) findViewById(R.id.tab3);
text = (TextView) findViewById(R.id.text);
tab1.setOnClickListener(listener);
相关新闻>>
最新推荐更多>>>
- 发表评论
-
- 最新评论 更多>>