第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

無(wú)法加載tabLayout

程序運(yùn)行不了,有碰到這個(gè)問(wèn)題的嗎,求解決方法 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.ksw.myapplication/com.ksw.myapplication.MainActivity}: android.view.InflateException: Binary XML file line #9: Error inflating class android.support.design.widget.TabLayout.TabView

正在回答

5 回答

那個(gè)布局文件的代碼貼上來(lái)看看啊

0 回復(fù) 有任何疑惑可以回復(fù)我~
#1

浪子_在路上 提問(wèn)者

布局代碼已經(jīng)貼出來(lái)了,能幫我看一下嗎
2015-12-18 回復(fù) 有任何疑惑可以回復(fù)我~
?<android.support.design.widget.TabLayout.TabView????????
????????android:id="@+id/id_tabLayout"
????????android:layout_width="match_parent"
????????android:layout_height="wrap_content"
????????app:tabMode="fixed"
????????app:tabGravity="fill"
????????app:tabTextColor="#ffffff"
????????app:tabIndicatorColor="@color/main_color"
????????app:tabSelectedTextColor="@color/main_color">
?
????</android.support.design.widget.TabLayout.TabView>
?<android.support.design.widget.TabLayout
????????android:id="@+id/id_tabLayout"
????????android:layout_width="match_parent"
????????android:layout_height="wrap_content"
????????app:tabMode="fixed"
????????app:tabGravity="fill"
????????app:tabTextColor="#ffffff"
????????app:tabIndicatorColor="@color/main_color"
????????app:tabSelectedTextColor="@color/main_color">
</android.support.design.widget.TabLayout>


0 回復(fù) 有任何疑惑可以回復(fù)我~

全部代碼都在這了,該引入的包都引入了,程序編譯能通過(guò),就是沒(méi)法運(yùn)行

0 回復(fù) 有任何疑惑可以回復(fù)我~
#1

喬小欠兒

額...抱歉,我沒(méi)用過(guò)這個(gè)組件,這個(gè)我沒(méi)看來(lái)問(wèn)題在哪..
2015-12-18 回復(fù) 有任何疑惑可以回復(fù)我~
這是布局文件:
<?xml?version="1.0"?encoding="utf-8"?>
<LinearLayout?xmlns:android="http://schemas.android.com/apk/res/android"
????xmlns:app="http://schemas.android.com/apk/res-auto"
????xmlns:tools="http://schemas.android.com/tools"
????android:layout_width="match_parent"
????android:layout_height="match_parent"
????tools:context=".MainActivity"
????android:orientation="vertical">
????<android.support.design.widget.TabLayout.TabView
????????android:id="@+id/id_tabLayout"
????????android:layout_width="match_parent"
????????android:layout_height="wrap_content"
????????app:tabMode="fixed"
????????app:tabGravity="fill"
????????app:tabTextColor="#ffffff"
????????app:tabIndicatorColor="@color/main_color"
????????app:tabSelectedTextColor="@color/main_color">

????</android.support.design.widget.TabLayout.TabView>
????<android.suport.v4.view.ViewPager
????????android:id="@+id/id_viewpager"
????????android:layout_width="match_parent"
????????android:layout_height="0dp"
????????android:layout_weight="1">

????</android.suport.v4.view.ViewPager>



</LinearLayout>

下面是MainActivity

package?com.ksw.myapplication;

import?android.os.Bundle;
import?android.support.design.widget.TabLayout;
import?android.support.v4.app.Fragment;
import?android.support.v4.app.FragmentActivity;
import?android.support.v4.app.FragmentPagerAdapter;
import?android.support.v4.view.ViewPager;

import?com.ksw.myapplication.fragement.FestivalCategoryFragment;

public?class?MainActivity?extends?FragmentActivity{
????private?TabLayout?mTabLayout;
????private?ViewPager?mViewPager;
????private?String[]?mTitles?=?new?String[]{"節(jié)日短信","發(fā)送記錄"};


????@Override
????protected?void?onCreate(Bundle?savedInstanceState)?{
????????super.onCreate(savedInstanceState);
????????setContentView(R.layout.activity_main);
????????initViews();
????}

????private?void?initViews()?{
?????????mTabLayout?=?(TabLayout)?findViewById(R.id.id_tabLayout);
?????????mViewPager?=?(ViewPager)?findViewById(R.id.id_viewpager);
?????????mViewPager.setAdapter(new?FragmentPagerAdapter(getSupportFragmentManager())?{
?????????????@Override
?????????????public?Fragment?getItem(int?position)?{
?????????????????return?new?FestivalCategoryFragment();
?????????????}

?????????????@Override
?????????????public?int?getCount()?{
?????????????????return?mTitles.length;
?????????????}

?????????????@Override
?????????????public?CharSequence?getPageTitle(int?position)?{
?????????????????return?mTitles[position];
?????????????}
?????????});
????????mTabLayout.setupWithViewPager(mViewPager);
????}


}

FestivalCategoryFragment.java

package?com.ksw.myapplication.fragement;

import?android.os.Bundle;
import?android.support.annotation.Nullable;
import?android.support.v4.app.Fragment;
import?android.view.LayoutInflater;
import?android.view.View;
import?android.view.ViewGroup;

/**
?*?Created?by?Windows?User?on?2015/12/18.
?*/
public?class?FestivalCategoryFragment?extends?Fragment?{
????@Nullable
????@Override
????public?View?onCreateView(LayoutInflater?inflater,?ViewGroup?container,?Bundle?savedInstanceState)?{
????????return?super.onCreateView(inflater,?container,?savedInstanceState);
????}
}


0 回復(fù) 有任何疑惑可以回復(fù)我~

貼上項(xiàng)目代碼哦我?guī)湍憧纯?/p>

0 回復(fù) 有任何疑惑可以回復(fù)我~
#1

浪子_在路上 提問(wèn)者

代碼都在下面了、
2015-12-18 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消

無(wú)法加載tabLayout

我要回答 關(guān)注問(wèn)題
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)