2015-01-10 55 views
3

在這個Andriod的材料設計庫使用RectangleButton時有問題http://imgur.com/sZHShFPAndroid的材料設計毛刺

XML代碼

<com.gc.materialdesign.views.ScrollView xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:tools="http://schemas.android.com/tools" 
xmlns:materialdesign="http://schemas.android.com/apk/res-auto" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:orientation="vertical" 
android:focusable="false" 
android:focusableInTouchMode="false" 
tools:context=".MainActivity$PlaceholderFragment"> 
<LinearLayout 
    android:orientation="vertical" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content"> 
    <view 
     class="com.it.university.lbu.ecogallery.EcoGallery" 
     android:layout_width="fill_parent" 
     android:layout_height="140dp" 
     android:id="@+id/gallery" 
     android:scaleType="fitXY" 
     android:visibility="visible"/> 
    <LinearLayout 
     android:orientation="vertical" 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent"> 

     <LinearLayout 
      android:orientation="horizontal" 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:focusable="false"> 

      <view 
       class="com.gc.materialdesign.views.ButtonRectangle" 
       android:layout_width="fill_parent" 
       android:layout_height="150dp" 
       android:id="@+id/view" 
       android:layout_weight="1" 
       android:background="#ff5146ff" 
       android:textSize="25dp" 
       android:text="General&#10; Blog"/> 

      <view 
       class="com.gc.materialdesign.views.ButtonRectangle" 
       android:layout_width="fill_parent" 
       android:layout_height="150dp" 
       android:id="@+id/view2" 
       android:layout_weight="1" 
       android:textColor="@color/material_blue_grey_800" 
       android:background="#ff67ce00" 
       android:padding="0dp" 
       android:textSize="25dp" 
       android:text="Branch&#10; Blog" /> 
     </LinearLayout> 

     <LinearLayout 
      android:orientation="horizontal" 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" > 

      <view 
       class="com.gc.materialdesign.views.ButtonRectangle" 
       android:layout_width="fill_parent" 
       android:layout_height="150dp" 
       android:id="@+id/view3" 
       android:layout_weight="1" 
       android:background="#ff0aff00" 
       android:padding="0dp" 
       android:textColor="@color/material_blue_grey_800" 
       android:textSize="25dp" 
       android:text="Personal&#10; Blog" /> 

      <view 
       class="com.gc.materialdesign.views.ButtonRectangle" 
       android:layout_width="fill_parent" 
       android:layout_height="150dp" 
       android:id="@+id/view4" 
       android:layout_weight="1" 
       android:background="#ff007ad4" 
       android:padding="0dp" 
       android:textSize="25dp" 
       android:text="My Friend" /> 
     </LinearLayout> 

     <LinearLayout 
      android:orientation="horizontal" 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" > 

      <view 
       class="com.gc.materialdesign.views.ButtonRectangle" 
       android:layout_width="fill_parent" 
       android:layout_height="150dp" 
       android:id="@+id/view5" 
       android:layout_weight="1" 
       android:background="#ffff0000" 
       android:padding="0dp" 
       android:textSize="25dp" 
       android:text="My Teacher" /> 

      <view 
       class="com.gc.materialdesign.views.ButtonRectangle" 
       android:layout_width="fill_parent" 
       android:layout_height="150dp" 
       android:id="@+id/view6" 
       android:layout_weight="1" 
       android:background="#ffc1ff00" 
       android:padding="0dp" 
       android:textSize="25dp" 
       android:text="Last News" 
       android:textColor="@color/material_blue_grey_800" 
       /> 

     </LinearLayout> 
    </LinearLayout> 
</LinearLayout> 

回答

0

我有一個2個解決方案爲您服務!

現在,正如你所看到的,這個庫已經很發達了,現在甚至Demo項目都沒有更新到它的庫。

所以,在這裏你可以做什麼:

  1. 使用舊庫版本,爲你工作。更新演示應用程序時更新。

  2. 等到所有這一切結束 - 所有控件都可以使用。一段時間沒有錯誤報告。

我電子郵件關於滾動開發的問題,但它不可能知道什麼時候這將是固定的,因爲他還沒有做出迴應。

UPDATE

這個庫是巨資開發 - 有時它不工作,但它會:)

我回答了你的問題嗎?

+0

謝謝,幫助我很多,但你知道我在哪裏可以找到舊圖書館。 –

+0

@ user3556648更新了答案。這裏是討論 - https://github.com/navasmdc/MaterialDesignLibrary/issues/103 – Inoy