Pla*_*eon 3 android adt android-layout
我尝试构建我的android项目时遇到错误:
在'android'包中找不到属性'margin'的资源标识符
它引用这种布局作为罪魁祸首.但我发现它没有任何问题.
任何想法为什么Eclipse会认为这些视图上没有保证金有利润?
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:background="@color/feedstory_background_color"
android:margin="5dp"
android:orientation="vertical"
android:padding="5dp" >
<RelativeLayout
android:id="@+id/feed_profile_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp" >
<ImageButton
android:id="@+id/feed_profileImage"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_alignParentLeft="true"
android:layout_margin="0dp"
android:background="@color/black_bg"
android:maxHeight="60dp"
android:maxWidth="60dp"
android:padding="1dp"
android:scaleType="centerInside"
android:src="@drawable/feed_blank_profile_picture" />
<LinearLayout
android:id="@+id/profile_texts"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginLeft="5dp"
android:layout_toRightOf="@id/feed_profileImage"
android:orientation="vertical" >
<TextView
android:id="@+id/profile_name_text"
style="@style/feed_profile_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/feed_profile_name" >
</TextView>
<TextView
android:id="@+id/profile_location_text"
style="@style/feed_profile_location"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/feed_profile_location" >
</TextView>
<TextView
android:id="@+id/profile_time_text"
style="@style/feed_profile_time"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/feed_profile_time" >
</TextView>
</LinearLayout>
<LinearLayout
android:id="@+id/profile_texts"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:orientation="vertical" >
<Button
android:id="@+id/fan_button"
style="@style/feed_button_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:background="@drawable/red_button"
android:margin="0dp"
android:minHeight="0dip"
android:minWidth="70dip"
android:padding="5dp"
android:text="@string/feed_fan_button" />
<TextView
android:id="@+id/fan_count_text"
style="@style/feed_button_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/grey_button"
android:margin="0dp"
android:minHeight="0dip"
android:minWidth="70dip"
android:padding="5dp"
android:text="000000" >
</TextView>
</LinearLayout>
</RelativeLayout>
<LinearLayout
android:id="@+id/content_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:orientation="vertical" >
<TextView
android:id="@+id/post_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/feed_default_post_text"
style="@style/feed_text_style"
>
</TextView>
</LinearLayout>
<RelativeLayout
android:id="@+id/feedback_buttons"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<Button
android:id="@+id/applaud_button"
style="@style/feed_button_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="2dp"
android:background="@drawable/red_button"
android:minHeight="0dip"
android:minWidth="70dip"
android:text="@string/feed_applaud_button" />
<TextView
android:id="@+id/applaud_count_text"
style="@style/feed_button_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginLeft="2dp"
android:layout_toRightOf="@id/applaud_button"
android:background="@drawable/grey_button"
android:margin="10dp"
android:padding="10dp"
android:text="000000" >
</TextView>
<Button
android:id="@+id/comment_button"
style="@style/feed_button_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginRight="2dp"
android:layout_toLeftOf="@+id/comment_count_text"
android:background="@drawable/red_button"
android:minHeight="0dip"
android:text="@string/feed_comment_button" />
<TextView
android:id="@+id/comment_count_text"
style="@style/feed_button_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginLeft="2dp"
android:layout_marginTop="0dp"
android:layout_weight="1"
android:background="@drawable/grey_button"
android:text="000000" >
</TextView>
</RelativeLayout>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
在每个方向上声明5p边距的正确属性名称是:
android:layout_margin="5dp"
Run Code Online (Sandbox Code Playgroud)
注意layout_前缀.您将要删除所说的行android:margin="5dp",这是Eclipse抱怨的原因.
完整的有效保证金属性包括:
layout_marginlayout_marginBottomlayout_marginEndlayout_marginLeftlayout_marginRightlayout_marginStartlayout_marginTop| 归档时间: |
|
| 查看次数: |
1811 次 |
| 最近记录: |