对app_bar_main的标签进行设计

This commit is contained in:
peaken 2018-05-15 17:11:17 +08:00
parent 0ef7855161
commit 4ed803ccb7
1 changed files with 23 additions and 0 deletions

View File

@ -0,0 +1,23 @@
package com.example.administrator.myapplication.ui;
import android.os.Bundle;
import android.support.design.widget.TabLayout;
import android.support.v7.app.AppCompatActivity;
import com.example.administrator.myapplication.R;
/**
* Created by Administrator on 2018/5/14 0014.
*/
public class app_bar_activity extends AppCompatActivity{
private TabLayout mTabLayout;
@Override
protected void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.app_bar_main);
mTabLayout = (TabLayout) findViewById(R.id.app_bar_tablayout);
mTabLayout.addTab(mTabLayout.newTab().setText("文章"));
mTabLayout.addTab(mTabLayout.newTab().setText("图片"));
}
}