Using Android Studio to implement the bottom tab function, the same code in Eclipse is not a problem, and now in the preview of as inside always error: Exception raised during Rendering:no tab known for tag Null
The XML source code is as follows:
<?xml version= "1.0" encoding= "Utf-8"? ><linearlayout xmlns:android= "http://schemas.android.com/apk/res/ Android "Android:layout_width=" Fill_parent "android:layout_height=" fill_parent "android:orientation=" vertical "&G T <framelayout android:id= "@+id/realtabcontent" android:layout_width= "Fill_parent" android:layout_he ight= "0dip" android:layout_weight= "1"/> <view android:layout_width= "Fill_parent" Android:la yout_height= "0.5DP" android:background= "#BFBFBF"/> <android.support.v4.app.fragmenttabhost Android : id= "@android: Id/tabhost" android:layout_width= "fill_parent" android:layout_height= "Wrap_content" and roid:background= "@drawable/maintab_bg" > <framelayout android:id= "@android: Id/tabcontent" Android:layout_width= "0DP" android:layout_height= "0DP" android:layout_weight= "0"/> </an Droid.support.v4.app.FragmentTabhost></linearlayout>
Gradle quoted the V7 package
Apply plugin: ' Com.android.application ' android { compilesdkversion buildtoolsversion "22.0.1" defaultconfig { ApplicationID "*************" minsdkversion targetsdkversion 1 Versionname "1.0" } Buildtypes { Release { minifyenabled false proguardfiles getdefaultproguardfile (' Proguard-android.txt '), ' Proguard-rules.pro ' } }}dependencies { compile filetree (dir: ' Libs ', Include: [' *.jar ']) testcompile ' junit:junit:4.12 ' compile ' com.android.support:appcompat-v7:22.2.1 ' compile ' com.android.support:design:22.2.1 ' compile ' com.jakewharton:butterknife:7.0.1 '}
Android Studio does not recognize the support.v4.app.FragmentTabHost issue.