【问题标题】:Load Image to the corner of ImageView加载Image到ImageView的角落
【发布时间】:2017-02-05 04:26:28
【问题描述】:

我需要在 Imageview 的一角加载特定尺寸的图片

我不想添加多个 Imageview,因为我不想丢失我的折叠工具栏动画

更新:添加了 xml 部分

<android.support.design.widget.CoordinatorLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@android:color/background_light"
    android:fitsSystemWindows="true">


     <net.opacapp.multilinecollapsingtoolbar.CollapsingToolbarLayout
                android:id="@+id/collapsing"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                app:layout_scrollFlags="scroll|exitUntilCollapsed"
                app:contentScrim="@color/darkGray"
                app:expandedTitleTextAppearance="@style/CollapsedAppBarTopic"
                app:expandedTitleMarginStart="10dp"
                app:expandedTitleMarginEnd="64dp"
                app:expandedTitleMarginBottom="5dp"

                >
                <ImageView
                    android:id="@+id/Image"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center"
                    android:adjustViewBounds="true"
                    app:layout_collapseMode="parallax"
                    />
                <android.support.v7.widget.Toolbar
                    android:id="@+id/main.toolbar"
                    android:layout_width="match_parent"
                    android:layout_height="?attr/actionBarSize"
                    app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
                    app:layout_collapseMode="pin"
                    />
            </net.opacapp.multilinecollapsingtoolbar.CollapsingToolbarLayout>
 </android.support.design.widget.AppBarLayout>

【问题讨论】:

  • 提交你的代码试验

标签: android xml layout imageview android-collapsingtoolbarlayout


【解决方案1】:

尝试在 Coordinator 布局中使用相对布局。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-08-22
    • 1970-01-01
    • 1970-01-01
    • 2019-01-13
    • 1970-01-01
    • 2012-12-14
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多