由于某些原因,需要个错位的页面,在网上找不到好的例子,试着动手写了写。不考虑配色的完成图如下: 首先考虑的是,listview每一行左右都有可能缩进。先假设一行的布局就是ImageView,TextView,ImageView,代码如下: 1 <LinearLay ...
由于某些原因,需要个错位的页面,在网上找不到好的例子,试着动手写了写。
不考虑配色的完成图如下:
首先考虑的是,listview每一行左右都有可能缩进。
先假设一行的布局就是ImageView,TextView,ImageView,代码如下:
1 <LinearLayout ="http://schemas.android.com/apk/res/android" 2 ="http://schemas.android.com/tools" 3 android:layout_width="match_parent" 4 android:layout_height="match_parent" 5 android:orientation="vertical"> 6 7 <RelativeLayout 8 android:id="@+id/rl_line" 9 android:layout_width="match_parent"10 android:layout_height="50dp">11 12 <ImageView 13 android:id="@+id/iv_left"14 android:layout_width="50dp"15 android:background="#cccccc"16 android:layout_height="match_parent"/>17 18 <ImageView19 android:id="@+id/iv_right"20 android:layout_width="50dp"21 android:background="#cccccc"22 android:layout_height="match_parent"23 android:layout_alignParentRight="true"/>24 25 <TextView 26 android:id="@+id/tv"27 android:layout_width="match_parent"28 android:layout_height="match_parent"29 android:layout_toRightOf="@id/iv_left"30 android:layout_toLeftOf="@id/iv_right"31 android:background="#ffffff"32 android:text="example"33 android:textSize="17sp"/>34 35 </RelativeLayout>36 37 </LinearLayout>
海外公司注册、海外银行开户、跨境平台代入驻、VAT、EPR等知识和在线办理:https://www.xlkjsw.com
原标题:Android中ListView错位布局实现(无聊向)
关键词:Android
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们:
admin#shaoqun.com
(#换成@)。