ListViewのカスタム行レイアウトxmlファイルを作成して、それぞれの行を見たいように設計できましたが、実際にUIを設計する際に問題がありますこのXMLファイル。私は最終的にはこのように見える活動をしようとしています:ListViewカスタム行のUIデザインを操作する(Android)
あなたは各タイトル、二つのボタンなどのTextViewでゲームから成る、行のリストビューがある見ることができるように、とバックグラウンドとしてのimageView私はGoogleのUIドキュメントを使って多くの研究をしてきましたが、このように要素を重ねて表示する方法を理解することはできません。私が得た最も遠いのは、FrameLayoutを使って異なるビューをお互いに配置することですが、ここからは、ビューをお互いに正しい位置に配置することはできません。どのようにこれを行うには、または私はこれを行う方法を見つけることができます上の任意のアドバイスですか?これまでのところ(私が知っている恐ろしい)
XML:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="top|center_horizontal">
<ImageView
android:id="@+id/gameImageID"
android:layout_width="340dp"
android:layout_height="160dp"
android:scaleType="centerCrop"
app:srcCompat="@drawable/overwatch" />
<TextView
android:id="@+id/gameNameID"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_gravity="center_horizontal"
android:layout_marginTop="15dp"
android:text="TextView" />
<Button
android:id="@+id/btnJoinLobby"
android:layout_width="88dp"
android:layout_height="wrap_content"
android:onClick="myClickHandlerJoin"
android:text="Join Lobby"
android:layout_gravity="center_horizontal"
android:layout_marginTop="15dp" />
<Button
android:id="@+id/btnCreateLobby"
android:layout_width="102dp"
android:layout_height="wrap_content"
android:onClick="myClickHandlerCreate"
android:text="Create Lobby"
android:layout_gravity="center_horizontal"
android:layout_marginTop="15dp"
android:layout_toEndOf="@+id/gameNameID" />
</RelativeLayout>
あなたのコードを見せてください。それは非常に簡単なデザインです – DroiDev
@DroiDevはカスタム行のxmlを追加しました –
あなたのコードとそのイメージを共有してください –