タイトルと閉じるボタンでダイアログがポップアップしています。これはXMLです:あなたはTextViewにはそれがマーキーのために必要なすべてのものを持って見ることができると同様マーキーとlayout_weightがスクロールしていないAndroid TextView
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center_vertical">
<TextView
android:id="@+id/text_title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginLeft="24dp"
android:layout_marginRight="0dp"
android:layout_marginTop="16dp"
android:layout_marginBottom="16dp"
android:maxLines="1"
<!--- android:singleLine="true" <-- Do not comment about this, it is deprecated --->
android:ellipsize="marquee"
android:marqueeRepeatLimit="marquee_forever"
android:scrollHorizontally="true"
android:focusable="true"
android:focusableInTouchMode="true"
android:textSize="20sp"
android:textColor="@android:color/black"
/>
<ImageView
android:id="@+id/backburger"
android:layout_width="32dp"
android:layout_height="32dp"
android:layout_marginStart="24dp"
android:layout_marginEnd="24dp"
android:layout_marginTop="16dp"
android:layout_marginBottom="16dp"
android:src="@drawable/ic_close"
android:foreground="?android:attr/selectableItemBackground"
/>
</LinearLayout>
は、singleLine
オプションは廃止されましたので、私はそれを使用することはできません。私はJavaのsetSelected(true)
を呼び出します。マーキーについては多くの質問がありますが、layout_weight
と'17 'はありません。
これは、XMLのプレビューです:
ここに私の答えhttps://stackoverflow.com/a/46360549/5381331を確認してください。 layout_weightでテストしたので、この問題は 'android:layout_weight'とは関係ありません。またhttps://stackoverflow.com/a/12005799/5381331を参照してください –