0
私は、左から右の順番でいくつかの要素を含むビューを作成しようとしています。私の現在のレイアウトは次のとおりです。AndroidLineLineoutをGridLayoutのLineに合わせる
<?xml version="1.0" encoding="utf-8"?>
<GridLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:columnCount="2">
<LinearLayout
android:orientation="horizontal"
android:layout_column="0"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/Image1"
android:layout_height="40dp"
android:layout_width="40dp"
android:layout_marginLeft="24dp"
android:layout_marginTop="24dp"
android:layout_marginBottom="16dp"
android:src="@drawable/image_src"
android:visibility="gone" />
<TextView
android:id="@+id/Text1"
android:text="SampleText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginBottom="16dp"
android:layout_marginTop="24dp"
android:textSize="16sp"
android:gravity="center" />
</LinearLayout>
<ImageButton
android:id="@+id/Button1"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_gravity="right"
android:layout_column="1"
android:src="@drawable/imageBtn"
style="?android:attr/borderlessButtonStyle" />
</GridLayout>
テキストが短い場合、すべてが
OKのようです。しかし、問題は、テキストが非常に長くなることができるということです、そして、それはボタンと重なります。
どのように私はそれの左隅に正確に包まれたボタンが常に表示やテキストことができますか?
あなたの期待される出力スクリーンショットを共有します –
あなたのビューに特定のサイズを与えて、それらが重ならないようにします。あなたはあなたのXMLやコードを使ってそれを行うことができます –
[GridLayoutとRow/Column Span Woe]の重複の可能性があります(http://stackoverflow.com/questions/11863329/gridlayout-and-row-column-span-woe) –