2016-03-07 130 views
0
<LinearLayout 
xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:custom="http://schemas.android.com/apk/res-auto" 
xmlns:app="http://schemas.android.com/tools" 
android:id="@+id/mainlayout" 
android:orientation="vertical" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:weightSum="1"> 
    <ImageView 
     android:id="@+id/imageview" 
     android:layout_width="match_parent" 
     android:layout_height="40dp"/> 
<LinearLayout 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:orientation="horizontal"> 
    <ImageButton 
     android:id="@+id/image_button" 
     android:layout_width="40dp" 
     android:layout_height="48dp" 
     android:layout_marginRight="-9dp" 
     android:src="@drawable/home_ico" 
     /> 
    <Button 
     android:id="@+id/internet" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:textSize="9sp" 
     android:layout_marginRight="-9dp" 
     android:text="@string/internet" 
     android:textColor="#ffffff" 
     android:layout_weight="1"/> 
    <Button 
     android:id="@+id/servisler" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:textSize="9sp" 
     android:layout_marginRight="-9dp" 
     android:text="@string/servisler" 
     android:textColor="#ffffff" 
     android:layout_weight="1"/> 
    <Button 
     android:id="@+id/kampanya" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:textSize="9sp" 
     android:layout_marginRight="-9dp" 
     android:text="@string/kampanya" 
     android:textColor="#ffffff" 
     android:layout_weight="1"/> 
     <Button 
      android:id="@+id/hakkımızda" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:textSize="9sp" 
      android:layout_marginRight="-9dp" 
      android:text="@string/hakkımızda" 
      android:textColor="#ffffff" 
      android:layout_weight="1"/> 
    <Button 
     android:id="@+id/spinner1" 
     android:layout_width="69dp" 
     android:textSize="9sp" 
     android:layout_height="48dp" 
     android:textColor="#ffffff" 
     android:layout_weight="1" 
     android:text="@string/diğer" 
     /> 
</LinearLayout> 
<LinearLayout 
    android:layout_width="match_parent" 
    android:layout_height="0dp" 
    android:orientation="horizontal" 
    android:layout_weight="0.5"> 
<android.support.v4.view.ViewPager 
    android:id="@+id/viewPager" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    > 
</android.support.v4.view.ViewPager> 
    <com.daimajia.slider.library.Indicators.PagerIndicator 
     android:id="@+id/custom_indicator" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:gravity="center" 
     custom:selected_color="#0095BF" 
     custom:unselected_color="#55333333" 
     custom:shape="rect" 
     custom:selected_padding_left="2dp" 
     custom:selected_padding_right="2dp" 
     custom:unselected_padding_left="2dp" 
     custom:unselected_padding_right="2dp" 
     custom:selected_width="6dp" 
     custom:selected_height="6dp" 
     custom:unselected_width="6dp" 
     custom:unselected_height="6dp" 
     /> 

</LinearLayout> 


在這個XML代碼,我想趁自己這個錯誤,我不知道why.This是完整的XML文件,該文件是above.And錯誤如下;Android的ViewPager指示燈

"rect" in attribute "shape" is not a valid integer 

所以,任何幫助將不勝感激。 編輯:現在我發佈了完整的XML。我沒有更多的話來形容,爲什麼這個東西想讓我添加一些細節!

+0

安置自己的完整的XML – Jas

+0

在這裏,你走了,我上傳它。 – Ali

回答

0

可用選項:

public enum Shape { 
    Oval,Rectangle 
} 

使用 「矩形」,而不是 「矩形」

<com.daimajia.slider.library.Indicators.PagerIndicator 
     android:id="@+id/custom_indicator" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:gravity="center" 
     custom:selected_color="#0095BF" 
     custom:unselected_color="#55333333" 
     custom:shape="rectangle" 
     custom:selected_padding_left="2dp" 
     custom:selected_padding_right="2dp" 
     custom:unselected_padding_left="2dp" 
     custom:unselected_padding_right="2dp" 
     custom:selected_width="6dp" 
     custom:selected_height="6dp" 
     custom:unselected_width="6dp" 
     custom:unselected_height="6dp" 
     /> 
+0

呃,我很困惑,我該把它放在哪裏? – Ali