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"

本文介绍了一个简单的VR小项目,利用Fragment、VR全景图和VR视频,展示了如何创建一个带有侧滑抽屉和ViewPager的界面。项目涉及到的主要技术包括:DrawerLayout、TabLayout、ViewPager以及自定义的Fragment。通过这个项目,读者可以了解到如何在Android中集成VR内容。
最低0.47元/天 解锁文章
377

被折叠的 条评论
为什么被折叠?



