小编ben*_*man的帖子

视图创建上的浮动操作按钮锚点更改

我在与FAB被锚定到ListView的问题(见视频实例),似乎通过改变锚位置上绘制闪烁.问题出现在模拟器中,也出现在我在API API级别19上测试过的任何设备上.

我有主要活动:

<LinearLayout
    android:id="@+id/main_layout"
    android:orientation="vertical"
    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">

    <!-- our toolbar -->
    <android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="?attr/colorPrimary"
        android:minHeight="?attr/actionBarSize"
        android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
        app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
        android:elevation="4dp"/>

    <!-- our tablayout to display tabs  -->
    <android.support.design.widget.TabLayout
        android:id="@+id/tabLayout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="?attr/colorPrimary"
        android:minHeight="?attr/actionBarSize"
        android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
        android:elevation="4dp"/>

    <!-- View pager to swipe views -->
    <android.support.v4.view.ViewPager
        android:id="@+id/pager"
        android:layout_width="match_parent"
        android:layout_height="fill_parent" />

</LinearLayout>
Run Code Online (Sandbox Code Playgroud)

然后保持底部导航

<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"
    android:orientation="vertical"
    android:background="#fff">

    <FrameLayout
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1"
        android:id="@+id/svBody"
        android:background="#fff">
    </FrameLayout>
    <android.support.design.widget.BottomNavigationView
        android:id="@+id/bottomNavigation"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom"
        app:itemBackground="@color/colorPrimary"
        android:background="@color/colorPrimary"
        app:itemIconTint="@color/cardview_light_background"
        app:itemTextColor="@color/cardview_light_background" …
Run Code Online (Sandbox Code Playgroud)

android listview android-fragments material-design

10
推荐指数
1
解决办法
513
查看次数

如何在视图中切换视图?

我正在制作一个使用MVVM光框架的WPF应用程序.

我要做的是在视图中有一个登录表单,当用户按下该视图中的按钮时,它会为附加的ViewModel启动LoginCommand.从那里我想要启动一个新窗口来保存应用程序的其余部分,或者只是从同一个窗口切换视图.

目前我有它,所以有一个名为MainView的视图,其内部控件内部绑定到View1.但是,要切换到View2,我需要在MainView上放置此按钮,而不是在它所属的View1中.

有什么建议?

c# wpf mvvm mvvm-light

8
推荐指数
1
解决办法
2589
查看次数