我有linearlayout
包含两个项目。当我更改第一项未显示的项目顺序时。这是我的代码,当textview在右边时:
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
>
<com.beardedhen.androidbootstrap.AwesomeTextView
android:id="@+id/fontAwesomeText3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="14dp"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:textColor="@color/icon_color3"
app:bootstrapBrand="success"
android:textSize="@dimen/big_icon_size"
app:fontAwesomeIcon="fa_reorder"
android:gravity="left" />
<TextView
android:id="@+id/text_summery"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:lineSpacingExtra="8dp"
android:maxLines="4"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#5A5A61"
android:textSize="13sp" />
</LinearLayout>
这是textview
位于左侧时的布局:
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
>
<TextView
android:id="@+id/text_summery"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:lineSpacingExtra="8dp"
android:maxLines="4"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#5A5A61"
android:textSize="13sp" />
<com.beardedhen.androidbootstrap.AwesomeTextView
android:id="@+id/fontAwesomeText3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="14dp"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:textColor="@color/icon_color3"
app:bootstrapBrand="success"
android:textSize="@dimen/big_icon_size"
app:fontAwesomeIcon="fa_reorder"
android:gravity="left" />
</LinearLayout>
但是当textview
位于左侧时,字体图标不显示。为什么?
答案 0 :(得分:0)
试试这个我希望这会有助于你的
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<TextView
android:id="@+id/text_summery"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<com.beardedhen.androidbootstrap.AwesomeTextView
..../>
</LinearLayout>