2017-08-03 169 views
-5

這種個性化或效果如何可能?自定義登錄屏幕

有一個背景屏幕,部分屏幕具有降級或純色。

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

嘗試對角佈局添加依賴

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

0

您可以使用adobexD這是相當簡單易用,爲用戶所做的接口。有幾個教程可用。 當你用你想要的漸變創建你的屏幕後,你可以導出它,並簡單地使用android:background與屏幕