tablayout

Cannot resolve findViewByID in AppCompatActivity

匿名 (未验证) 提交于 2019-12-03 09:02:45
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm following this tutorial: Android Material Design Using Tabs Infos: Android API Level 21 Dependecies are added to graddle file compile 'com.android.support:appcompat-v7:23.0.1' and compile 'com.android.support:design:23.0.1' } The method "findViewById" cannot be resolved. I tried to follow this answer Cannot resolve method 'findViewById(int)' in Fragment , but this AppCompatActivity use OnCreateBundle instead OnCreateView, then i can't get the View object... What is wrong with this code ? I'm missing some import? package info.androidhive

Different tabMode for TabLayout

匿名 (未验证) 提交于 2019-12-03 08:52:47
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I`m using ViewPager and TabLayout. If tabs can be placed on the display tabMode they must be: app:tabMode="fixed" else app:tabMode="scrollable" How can I do this? 回答1: I din't get your question but i may help you, if tabs count is static or fixed(you know number of tabs) then app:tabMode="fixed" if tabs count is dynamic(data coming from feed) then app:tabMode="scrollable" 回答2: If the problem is that for certain screen configurations (e.g. small screens, portrait config, etc.) the tabs need to be scrollable because they don't fit the screen

AppBarLayout + TabLayout + CollapsingToolbarLayout + SwipeToRefresh

匿名 (未验证) 提交于 2019-12-03 02:48:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I met a lot of issues related with my problem but nobody I found wanted the behaviour I'm looking for. I want a view pager with tabs and app bar, when the contained fragments are scrollable and are scrolled (toward bottom), I want the app bar to disapear but leave the tabs, when scrolled toward top, to re-apear. some of these fragments contain a SwipeToRefresh Layout (sometimes it causes problems). I tried a lot of configurations that always leave something wrong. for now I don't have the collapsing effect (it's always hidden) <?xml version=

Fix bottom bar in CoordinatorLayout

匿名 (未验证) 提交于 2019-12-03 02:45:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a CoordinatorLayout which contains AppBarLayout and a FrameLayout which contains fragments. One of this fragment contains a TabLayout at Top, one List trough RecyclerView and at the Bottom one "homemade" toolbar. The AppBarLayout is configured with app:layout_scrollFlags="scroll|enterAlways" My problem is that both "toolbars" are hiding when scroll, the AppBarLayout and my "homemade" toolbar at the bottom. This is the current behaviour I would like to fix the bottom "homemade" toolbar to keep visible but I can't achieve it. This is

Got Error inflating class android.support.design.widget.TabLayout

匿名 (未验证) 提交于 2019-12-03 02:31:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to create a menu tab based on Google's "material design" using Eclipse, but I got an error: 01-07 01:02:10.238: E/tag(6696): contact on create called 01-07 01:02:10.301: E/AndroidRuntime(6696): FATAL EXCEPTION: main 01-07 01:02:10.301: E/AndroidRuntime(6696): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.rvappsstudios.designflashalerts/com.rvappsstudios.designflashalerts.MainActivity}: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.rvappsstudios.designflashalerts/com.rvappsstudios

How to pass list &lt;object&gt; between fragment

匿名 (未验证) 提交于 2019-12-03 01:49:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I've created my layout with viewPager and TabLayout: public class HomeFragment extends Fragment { public static TabLayout tabLayout; public static ViewPager viewPager; public static int int_items = 3 ; public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View inflatedView = inflater.inflate(R.layout.fragment_home, container,false); viewPager = (ViewPager) inflatedView.findViewById(R.id.viewpager); int [] drawables = {R.drawable.home,R.drawable.street,R.drawable.map}; Bundle bundle = new Bundle()

Android TabLayout tabPaddingTop and tabPaddingBottom not being removed

匿名 (未验证) 提交于 2019-12-03 01:39:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Here is my tab layout XML <android.support.design.widget.TabLayout android:id="@+id/tabs" android:layout_width="match_parent" android:layout_height="@dimen/custom_tab_layout_height" android:background="@color/tab_background_primary" app:tabGravity="fill" app:tabIndicatorColor="@color/primary_white" app:tabIndicatorHeight="3dp" app:tabMinWidth="120dp" app:tabMode="scrollable" app:tabPaddingStart="-1dp" app:tabPaddingEnd="-1dp" app:tabPaddingTop="1dp" app:tabPaddingBottom="1dp" /> It is removing the horizontal padding in between tabs but not

Error - No instrumentation registered! Must run under a registering instrumentation

匿名 (未验证) 提交于 2019-12-03 01:34:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: A) Why when i try to run the app i get this error? My Crash Log Error Unable to start activity ComponentInfojava.lang.IllegalStateException: No instrumentation registered! Must run under a registering instrumentation. What caused that? I'm yet learning and i'll appreciate if you can explain more. This is my code import android.app.ProgressDialog; import android.os.AsyncTask; import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentPagerAdapter;

tabMode=“scrollable” not working

匿名 (未验证) 提交于 2019-12-03 01:22:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am using the TabLayout from Android Design support library. I am using material design theme. Below is the code activity_scrollable_Tab.xml <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"> <android.support.design.widget.AppBarLayout <android.support.design.widget.TabLayout android:id="@+id/tabs" android:layout_width="match_parent" android:layout_height="wrap_content" app:tabMode="scrollable"/> </android

How to change the font of tabLayout with a custom font / calligraphy

匿名 (未验证) 提交于 2019-12-03 01:03:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I was looking for answers about how I can change the fonts of those tabs in that TabLayout to a custom font. I tried this but it didnt work Typeface hero = Typeface.createFromAsset(getContext().getAssets(),"fonts/Hero Light.otf"); textViewToConvert.setTypeface(hero); } } 回答1: In your layout <android.support.design.widget.TabLayout android:id="@+id/sliding_tabs" style="@style/Tab" android:layout_width="match_parent" android:layout_height="54dp" app:tabTextAppearance="@style/MineCustomTabText"/> and in your style folder <style name=