请教一个android布局的问题.. 布局textviewimageviewandroid 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent"> <ImageView android:id="@+id/iv" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/ic_launcher" android:layout_alignParentRight="true" /> <TextView android:layout_toLeftOf="@id/iv" android:layout_width="fill_parent" android:layout_height="fill_parent" android:singleLine="true" android:ellipsize="end" android:text="我我 我我 我我我我我我 我我我我我我 我我我我我我 我我我我我我 我我我我我我 我我我我我我 我我我我我我 我我我我我我 我我我我我我 我我我我我我 我我我我我我 我我我我我我 我我我我我我我我" /></RelativeLayout> 楼上的可以,我是这样的:<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="horizontal" > <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:drawableRight="@drawable/ic_launcher" android:singleLine="true" android:ellipsize="end" android:gravity="center" android:text="哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈" /></LinearLayout> 如果是多个imageview,或者其他的控件,就不能用这个.. 界面的方法没想到,代码应该是说可以实现的:在xml里面可以用toRright的方法让图片在textview后面,代码里面做个判断,当数据超过屏幕宽度时,就动态改变图片的位置,设置图片为:alignParentRight这个属性。 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" > <TextView android:id="@+id/textView01" android:layout_width="parent.width - pic.width" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_centerVertical="true" android:singleLine="true" /> <ImageView android:id="@+id/imageView01" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true" android:layout_centerVertical="true" android:contentDescription="@string/delete" android:src="@drawable/ic_launcher" /></RelativeLayout> 可以用TableLayout 内嵌TableRow形式,试下噢 有用请给分~~ TableLayout可以...结贴给分了... 100分求:应用到底安装到哪里去了? 关于WebView的一个小问题 Dialog的使用 android STK的问题??? 为什么要点两次返回才能回到上个activity????? 回声消除 下了一个Android API合集, 想查询一下android API. Android 应用 怎么读取自身apk文件 (data/app目录下的) 关于libcurl问题的请教; 我的android studio 启动就这样求教 android,xmpp注册的时候怎么同时创建VCard 如何下载android SDK?
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ImageView
android:id="@+id/iv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/ic_launcher"
android:layout_alignParentRight="true"
/>
<TextView
android:layout_toLeftOf="@id/iv"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:singleLine="true"
android:ellipsize="end"
android:text="我我 我我 我我我我我我 我我我我我我 我我我我我我 我我我我我我 我我我我我我 我我我我我我 我我我我我我 我我我我我我 我我我我我我 我我我我我我 我我我我我我 我我我我我我 我我我我我我我我"
/>
</RelativeLayout>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" >
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:drawableRight="@drawable/ic_launcher"
android:singleLine="true"
android:ellipsize="end"
android:gravity="center"
android:text="哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈"
/>
</LinearLayout>
如果是多个imageview,或者其他的控件,就不能用这个..
android:layout_width="wrap_content"
android:layout_height="wrap_content" > <TextView
android:id="@+id/textView01"
android:layout_width="parent.width - pic.width"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:singleLine="true" /> <ImageView
android:id="@+id/imageView01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:contentDescription="@string/delete"
android:src="@drawable/ic_launcher" /></RelativeLayout>
TableLayout可以...结贴给分了...