应用程序崩溃:viewpager [英] App crashes : viewpager

查看:87
本文介绍了应用程序崩溃:viewpager的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以告诉我,如果我将viewpager放在同一个xml文件中,为什么我的应用程序会崩溃.

Can someone please tell me why my app crashes if I put something with a viewpager in the same xml file.Thanks.

   <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <com.example.g514110.com.SlidingTabLayout
        android:id="@+id/sliding_tabs"
        android:background="#ddd"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />

    <android.support.v4.view.ViewPager
        android:id="@+id/viewpager"
        android:layout_width="match_parent"
        android:layout_height="0px"
        android:layout_weight="1"
        android:background="@android:color/white"/>

</LinearLayout>here

推荐答案

问题解决了!!我在xml文件中得到了"com.example.g514110.com.SlidingTabLayout"错误,实际上不是"com.example.g514110.com.SlidingTabLayout",而是"com.example.g514110.ihmslidingtabs.SlidingTabLayout".非常感谢!!

Problem solved!! I got the "com.example.g514110.com.SlidingTabLayout" in the xml file wrong actually it's not "com.example.g514110.com.SlidingTabLayout", it's "com.example.g514110.ihmslidingtabs.SlidingTabLayout".Thanks a lot!!

这篇关于应用程序崩溃:viewpager的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆