自定义登录屏幕

时间:2017-08-03 12:24:39

标签: android xml android-layout android-custom-view

这种个性化或效果怎么可能?

背景屏幕的部分屏幕会有降级或纯色。

enter image description here

enter image description here

我尝试使用渐变形状:

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">
    <gradient
        android:startColor="#c53766"
        android:endColor="#8149aa"
        android:angle="135"></gradient>
</shape>

如何根据示例图像进行登录屏幕的自定义。 有什么想法帮助我吗?

2 个答案:

答案 0 :(得分:2)

尝试对角线布局添加依赖

compile 'com.github.florent37:diagonallayout:1.0.7'

并使用以下代码

<com.github.florent37.diagonallayout.DiagonalLayout
        android:layout_width="match_parent"
        android:layout_height="250dp"
        android:elevation="10dp"
        app:diagonal_angle="20"
        app:diagonal_position="top"
        app:diagonal_direction="right">

        <ImageView
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:scaleType="centerCrop"
            android:src="@drawable/mountains" />

</com.github.florent37.diagonallayout.DiagonalLayout>

有关详情,请查看 this link

答案 1 :(得分:0)

您可以使用adobexD,它非常易于使用并用于用户界面。有几个教程可用。 在使用您想要的渐变创建屏幕后,您可以将其导出并只使用带屏幕的android:background