前提・実現したいこと
写真のようにしたい。万が一本文の中身が多い場合はタイトルの高さもその高さに合わせたい。
発生している問題・エラーメッセージ
該当のソースコード
Java
1// 連絡先一覧 2 List<String[]> reworkorderlist = getReworkOrderList(mRework_id, ordcat, appsrv_cd); 3 for (String[] rework : reworkorderlist) { 4 LinearLayout title = (LinearLayout) layout.findViewById(R.id.reworkorderlist); 5 LinearLayout value = (LinearLayout) layout.findViewById(R.id.reworkorderlist1); 6 // 項目名 7 TextView tv_title = new TextView(new ContextThemeWrapper(mActivity, R.style.ReworkListHeader)); 8 tv_title.setText(Html.fromHtml(rework[0] + " ")); 9 tv_title.setTextSize(12); 10 //tv_title.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT)); 11 title.addView(tv_title); 12 // 値 13 TextView tv_value = new TextView(new ContextThemeWrapper(mActivity, R.style.ReworkListCell)); 14 tv_value.setAutoLinkMask(Linkify.PHONE_NUMBERS); 15 tv_value.setText(Html.fromHtml(rework[1] + " ")); 16 tv_value.setTextSize(14); 17 //tv_value.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT)); 18 value.addView(tv_value); 19 20 21 22
xml
1 2 <ScrollView! android:id="@+id/scrollView1" 3 android:layout_width="match_parent" 4 android:layout_height="wrap_content" 5 android:background="@color/black" 6 android:scrollbarStyle="outsideInset" > 7 8 <LinearLayout 9 android:layout_width="match_parent" 10 android:layout_height="match_parent" 11 android:layout_marginTop="5dp" 12 android:background="@color/black" 13 android:orientation="horizontal" > 14 15 <LinearLayout 16 android:id="@+id/reworkorderlist" 17 android:layout_width="80dp" 18 android:layout_height="match_parent" 19 android:layout_marginLeft="1.3dp" 20 android:layout_weight="0" 21 android:background="@color/tell_list_head_background1" 22 android:orientation="vertical" > 23 24 </LinearLayout> 25 26 <LinearLayout 27 android:id="@+id/reworkorderlist1" 28 android:layout_width="match_parent" 29 android:layout_height="wrap_content" 30 android:background="@color/table_list_background" 31 android:orientation="vertical" > 32 33 </LinearLayout> 34 </LinearLayout> 35 </ScrollView>
試したこと
LinearLayoutの向きを変えるなどしてみたが分からない。
ListViewでやるほうができるのかなとは考えていますがやり方が
補足情報(FW/ツールのバージョンなど)
ここにより詳細な情報を記載してください。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/11/26 00:07
退会済みユーザー
2018/11/26 11:12
2018/11/27 07:23
2018/11/27 07:24
2018/11/27 07:24
2018/11/27 07:25
退会済みユーザー
2018/11/27 11:10
2018/11/28 00:35