【发布时间】:2021-01-21 20:01:45
【问题描述】:
我正在尝试为微调器内的 textView 设置边距。但是在 textView 中设置边距似乎不起作用。
tv_entity.xml
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/tvListEntity"
android:layout_width="match_parent"
android:layout_height="40dp"
android:background="@drawable/item_search_list"
android:fontFamily="@font/poppins_bold"
android:gravity="center_vertical"
android:paddingStart="40dp"
android:paddingEnd="20dp"
android:text="@string/enter_email"
android:textColor="@color/search"
android:textSize="15sp"
app:drawableRightCompat="@drawable/ic_baseline_add_circle_24"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_goneMarginTop="20dp" />
设置适配器:-
val arrayAdapter = ArrayAdapter(requireContext(),R.layout.tv_entity,arrayList)
我基本上需要在 textView 的左右和顶部留出一些空间。
【问题讨论】:
标签: android xml android-layout kotlin material-design