VR小项目(一)

本文介绍了一个简单的VR小项目,利用Fragment、VR全景图和VR视频,展示了如何创建一个带有侧滑抽屉和ViewPager的界面。项目涉及到的主要技术包括:DrawerLayout、TabLayout、ViewPager以及自定义的Fragment。通过这个项目,读者可以了解到如何在Android中集成VR内容。
摘要由CSDN通过智能技术生成
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

在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"
<
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值