小编Jul*_*an 的帖子

Android XML FrameLayout和BottomNavigationView

如何使BottomNavigationView的开头结束FrameLayout?FrameLayout的内容正在被导航视图重叠.

这是xml:

<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout 
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:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent" tools:context="...">

<FrameLayout
    android:id="@+id/content"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

</FrameLayout>

<android.support.design.widget.BottomNavigationView
    android:id="@+id/navigation"
    android:layout_width="0dp"
    android:layout_height="wrap_content"
    android:layout_marginEnd="0dp"
    android:layout_marginStart="0dp"
    android:background="?android:attr/windowBackground"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintLeft_toLeftOf="parent"
    app:layout_constraintRight_toRightOf="parent"
    app:menu="@menu/navigation" />

</android.support.constraint.ConstraintLayout>
Run Code Online (Sandbox Code Playgroud)

xml android android-framelayout bottomnavigationview

11
推荐指数
3
解决办法
4210
查看次数

Haskell类具有多态数据定义的实例

关于具有多态数据类型的类定义,我有一个问题.让我们说定义的数据类型是:

data BTree a = BLeaf a | BNode a (BTree a) (BTree a) deriving(Show)
Run Code Online (Sandbox Code Playgroud)

假设我想要检索树根的值,但是在名为Tree的类的实例中:

class Tree a where
             getRoot:: a -> (?)  --<- Type of Leave value as return type
Run Code Online (Sandbox Code Playgroud)

和一个实例:

instance Tree (BTree a) where
                        getRoot BLeaf a = a
                        getRoot BNode a _ _ = a
Run Code Online (Sandbox Code Playgroud)

我无法弄清楚函数的类型(参见questionmark),因为它不是a而且类不知道实例的参数.

polymorphism haskell functional-programming

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