私は、左側に描画可能なアイコンを持つテキストビューがほとんどありません。 レイアウト:TextView set DrawableRight/Left ...アラインメント
<android.support.v7.widget.CardView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/card_margin">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="@dimen/detail_padding">
<TextView
android:id="@+id/location"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/title_margin"
android:drawableLeft="@drawable/ic_location"
android:drawablePadding="@dimen/drawable_padding"
android:drawableStart="@drawable/ic_location" />
<TextView
android:id="@+id/status"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/title_margin"
android:drawableLeft="@drawable/ic_status"
android:drawablePadding="@dimen/drawable_padding"
android:drawableStart="@drawable/ic_status"/>
<TextView
android:id="@+id/description"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/title_margin"
android:drawableLeft="@drawable/ic_description"
android:drawablePadding="@dimen/drawable_padding"
android:drawableStart="@drawable/ic_description"/>
</LinearLayout>
</android.support.v7.widget.CardView>
スクリーンショット:
テキストが大きすぎる場合は、アイコンがTextViewの中央に立ちます。私はiconviewのtopをtextviewに設定したい。出来ますか?
あなたの完全なXMLレイアウト – Jeevanandhan
を投稿私はあなたがこのリンクの答えを見ることをお勧めここhttp://stackoverflow.com/questions/10267352です/ textviewの先頭に/ 28906636#28906636] [1] –
私はdrawableをtextviewの左上隅に設定したい –