Android可视寻呼机指示器
在下面的xml代码中,我得到以下错误: 属性“shape”中的“rect”不是有效的整数 这是完整的xml文件:Android可视寻呼机指示器,android,xml,android-studio,Android,Xml,Android Studio,在下面的xml代码中,我得到以下错误: 属性“shape”中的“rect”不是有效的整数 这是完整的xml文件: <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/
<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>
</LinearLayout>
可用选项:
public enum Shape {
Oval,Rectangle
}
使用“矩形”而不是“矩形”
给你,我上传了。请尝试重建。库可能尚未正确添加。如果不起作用,你可以用0表示椭圆,1表示矩形。嗯,我不知道应该把它放在哪里?
<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"
/>