9

У меня проблема с файлом XMl в файле v17/mr-media_route_list_item.xml.Идентификатор ресурса для атрибута 'paddingEnd' в пакете 'android'

Я продолжаю получать эту ошибку и еще не нашел решение!

Вот printshot из XML и проблем *

XML код, приведенный ниже:

<?xml version="1.0" encoding="utf-8"?> 
<!-- Copyright (C) 2013 The Android Open Source Project 

    Licensed under the Apache License, Version 2.0 (the "License"); 
    you may not use this file except in compliance with the License. 
    You may obtain a copy of the License at 

      http://www.apache.org/licenses/LICENSE-2.0 

    Unless required by applicable law or agreed to in writing, software 
    distributed under the License is distributed on an "AS IS" BASIS, 
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
    See the License for the specific language governing permissions and 
    limitations under the License. 
--> 

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
       android:layout_width="match_parent" 
       android:layout_height="?android:attr/listPreferredItemHeight" 
       android:gravity="center_vertical"> 

    <LinearLayout android:layout_width="0dp" 
        android:layout_height="match_parent" 
        android:layout_weight="1" 
        android:orientation="vertical" 
        android:gravity="start|center_vertical" 
        android:paddingStart="?android:attr/listPreferredItemPaddingStart" 
        android:paddingEnd="?android:attr/listPreferredItemPaddingEnd" 
        android:duplicateParentState="true"> 

     <TextView android:id="@android:id/text1" 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:singleLine="true" 
        android:ellipsize="marquee" 
        android:textAppearance="?android:attr/textAppearanceMedium" 
        android:duplicateParentState="true" /> 

     <TextView android:id="@android:id/text2" 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:singleLine="true" 
        android:ellipsize="marquee" 
        android:textAppearance="?android:attr/textAppearanceSmall" 
        android:duplicateParentState="true" /> 
    </LinearLayout> 

</LinearLayout> 
+0

Пожалуйста, разместите фактический xml как часть вашего вопроса. – Emmanuel

+1

Какова ваша цель Api и Min Api? –

+0

в файле манифеста для этой библиотеки minSdkVersion = 7. Нет версии SDK версии, объявленной – AndroidKrayze

ответ

31

android:paddingStart и android:paddingEnd были добавлены в уровне API 17. Ваша цель сборки (например, Project> Properties> Android в Eclipse) должен быть уровень API 17 или выше для тех, кто будет распознан.

+0

Это было благодарность за решение! – AndroidKrayze

+0

Да, вы случайно поставили аналогичную проблему для меня. Благодаря! – RossC

+0

Спасибо за ваш ответ! Это отлично работает для меня. –

Смежные вопросы