2017-02-27 42 views
-1

我有意開發像Google Play一樣的安裝屏幕。現在,由於一個問題,我一開始就陷入困境。設計像Google Play一樣的安裝屏幕

我不知道如何設計此視圖,如下圖所示。

img

+0

你能更具體一點嗎?你現在的佈局是什麼樣的? – Blaasd

+0

嗨@Blaasd,謝謝你的迴應。我只是想創建像上面的圖片的自定義視圖。我使用此視圖來顯示我的應用程序的信息,如下載數量,評分,... – AnhDH

+0

您目前的嘗試是什麼樣的? – Blaasd

回答

1

我剛纔想的第一個項目。接下來的項目,我認爲你需要你svg或png作爲背景。

enter image description here

佈局

<RelativeLayout 
     android:layout_width="50dp" 
     android:layout_height="50dp" 
     android:background="@drawable/corner_red_stroke"> 

     <TextView 
      android:layout_width="50dp" 
      android:layout_height="50dp" 
      android:gravity="center" 
      android:text="10" 
      android:paddingBottom="4dp" 
      android:textSize="20sp" /> 

     <TextView 
      android:layout_width="50dp" 
      android:layout_height="13dp" 
      android:layout_alignParentBottom="true" 
      android:layout_marginLeft="5dp" 
      android:layout_marginRight="5dp" 
      android:background="@drawable/corner_red_solid" 
      android:gravity="center" 
      android:text="MILLION" 
      android:textColor="#ffffff" 
      android:textSize="8sp" /> 

    </RelativeLayout> 

corner_red_solid.xml

<?xml version="1.0" encoding="utf-8"?> 
<shape xmlns:android="http://schemas.android.com/apk/res/android" 
     android:shape="rectangle" android:padding="10dp"> 
    <solid android:color="#ff0105"/> 
    <corners android:radius="50dp"/> 
    <stroke android:width="1dp" android:color="#ff0105" /> 

</shape> 

corner_red_stroke.xml

<?xml version="1.0" encoding="utf-8"?> 
<shape xmlns:android="http://schemas.android.com/apk/res/android" 
     android:shape="rectangle" android:padding="10dp"> 
    <corners android:radius="50dp"/> 
    <stroke android:width="1dp" android:color="#ff0105" /> 

</shape> 
+0

這個答案太棒了。非常感謝你的回答。你節省了我的一天:D – AnhDH