VR小项目(一)
效果图
侧滑抽屉显示 全景图显示界面 视屏显示界面 视屏播放界面
这是一个简单的VR小项目运用到了Fragment,VR全景图,VR视屏
VR
1.在主布局文件activity_main中添加一个LinearLayout布局在LinearLayout中添加一个TableLayout和一个ViewPager,在添加TableLayout的时候需要关联以下这两个包:
com.android.support:appcompat-v7:25.2.0
com.android.support:design:25.2.0
步骤:按住control+alt+shift+s会弹出一个Project Structure点击所要添加的项目,点击Dependencies,点击+号,选择Library Dependency
com.android.support:appcompat-v7:25.2.0
com.android.support:design:25.2.0
步骤:按住control+alt+shift+s会弹出一个Project Structure点击所要添加的项目,点击Dependencies,点击+号,选择Library Dependency
在LinearLayout布局外添加一个次布局fragment,最后将RelativeLayout改为V4包的DrawerLayout:
android.support.v4.widget.DrawerLayout
<?xml version="1.0" encoding="utf-8"?> <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@android:color/white"> <!--这里用到了Android5.0的新特性,也可以用slidingMenu--> <LinearLayout android:id="@+id/ll_main" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <android.support.design.widget.TabLayout android:id="@+id/tab_layout" android:layout_width="match_parent" <