右键-----New-----Activity <pre code_snippet_id="1873233" snippet_file_name="blog_20160909_1_1860383" name="code" class="html">android.content.Intent;
//切换界面
startActivity(new Intent(MainActivity.this,TwoActivity.class));
//切换界面效果
overridePendingTransition(android.R.anim.slide_in_left,android.R.anim.slide_out_right);
//跳转后讲当前的页面放在Task栈的最上面,如果存在就不创建。
startActivity(new Intent(ClothesActivity.this,FirstActivity.class).addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP));
//当删除调用
@Override protected void onDestroy() { super.onDestroy(); //调用父类删除 }
去掉默认的蓝标题框
修改 Res---values---styles.xml
第一种: Theme.AppCompat.Light.DarkActionBar 改为Theme.AppCompat.Light.NoActionBar
第二种:<itemname="windowNoTitle">true</item>
屏蔽状态栏,全屏显示 style文件
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"> <!-- Customize your theme here. --> <item name="colorPrimary">@color/colorPrimary</item> <item name="colorPrimaryDark">@color/colorPrimaryDark</item> <item name="colorAccent">@color/colorAccent</item> <item name="android:windowFullscreen">true</item> </style>
布局文件:android:theme="@style/AppTheme"
滑动条:
HorizontalScrollView水平滑动条下面只能添加一个控件,添加LinearLayout,再往这个布局里添加控件。
android:scrollbars="none" 不显示滑动条
android:fillViewport="true" 填满滑动条