Questions tagged «android-support-design»


10
BottomNavigationView始终显示图标和文本标签
我正在使用设计支持库版本25中的android.support.design.widget.BottomNavigationView compile 'com.android.support:design:25.0.0' <android.support.design.widget.BottomNavigationView android:id="@+id/bottomBar" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_gravity="center" app:itemBackground="@color/colorPrimary" app:menu="@menu/bottom_navigation_main" android:forceHasOverlappingRendering="true"/> 当@ menu / bottom_navigation_main中只有三个操作时,它将始终显示图标和文本标签。 当动作多于三个时,始终显示图标和文本标签的方式是什么?

28
禁止用户在BottomSheet上拖动
我试图禁止用户拖动BottomSheet。我要禁用的原因有两点。1.防止ListView向下滚动。2.我不希望用户通过拖动来撤消操作,而是使用上的按钮BottomSheetView。这就是我所做的 bottomSheetBehavior = BottomSheetBehavior.from(bottomAnc); bottomSheetBehavior.setBottomSheetCallback(new BottomSheetBehavior.BottomSheetCallback() { @Override public void onStateChanged(@NonNull View bottomSheet, int newState) { if (newState == BottomSheetBehavior.STATE_EXPANDED) { //Log.e("BottomSheet", "Expanded"); } else if (newState == BottomSheetBehavior.STATE_COLLAPSED) { //Log.e("BottomSheet", "Collapsed"); } } @Override public void onSlide(@NonNull View bottomSheet, float slideOffset) { // React to dragging events bottomSheet.setOnTouchListener(new View.OnTouchListener() …

14
将BottomSheetDialogFragment的状态设置为展开
如何使用Android支持设计库(v23.2.1)设置扩展BottomSheetDialogFragment为扩展的片段的状态BottomSheetBehavior#setState(STATE_EXPANDED)? https://code.google.com/p/android/issues/detail?id=202396说: 首先将底页设置为STATE_COLLAPSED。如果要扩展它,请调用BottomSheetBehavior#setState(STATE_EXPANDED)。请注意,您不能在视图布局之前调用该方法。 该建议的做法需要将第一膨胀的观点,但我不知道我怎么会设置BottomSheetBehaviour到片段(BottomSheetDialogFragment)。 View bottomSheet = coordinatorLayout.findViewById(R.id.bottom_sheet); BottomSheetBehavior behavior = BottomSheetBehavior.from(bottomSheet);

7
来自官方设计库的带有FloatingActionButton的InflateException
我正在使用FloatingActionButtonGoogle支持设计库中的官员提供的错误。 这是我的LogCat。 android.view.InflateException: Binary XML file line #34: Error inflating class android.support.design.widget.FloatingActionButton at android.view.LayoutInflater.createView(LayoutInflater.java:633) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:743) at android.view.LayoutInflater.rInflate(LayoutInflater.java:806) at android.view.LayoutInflater.rInflate(LayoutInflater.java:809) at android.view.LayoutInflater.inflate(LayoutInflater.java:504) at de.robv.android.xposed.XposedBridge.invokeOriginalMethodNative(Native Method) at de.robv.android.xposed.XposedBridge.handleHookedMethod(XposedBridge.java:655) at android.view.LayoutInflater.inflate(Unknown Source) at android.view.LayoutInflater.inflate(LayoutInflater.java:414) at ---.---.com.---.SubCategoryFragment.onCreateView(SubCategoryFragment.java:47) at android.support.v4.app.Fragment.performCreateView(Fragment.java:1789) at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:955) at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1138) at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:740) at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1501) at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:458) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) …
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.