我在父线性布局中有两个线性布局。所有水平。我想要全部l_child展示和部分r_child展示;而其余的r_child将在屏幕外右侧。我如何做到这一点?
<LinearLayout
android:orientation="horizontal" >
<LinearLayout
android:id="@+id/l_child"
android:orientation="horizontal" >
</LinearLayout>
<LinearLayout
android:id="@+id/r_child"
android:orientation="horizontal" >
</LinearLayout>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud) 基本上我正在考虑的另一个选项是具有背景的RelativeLayout.然后在布局中,将图像放在左侧,将文本放在右侧.我想我在某处读到了一个带有伴随图像的TextView.所以我想知道我想要的是一个textview是否可能?
背景将是某种颜色的圆角矩形
图像位于左侧
案文将在右边.
android textview relativelayout android-layout android-imageview
我有一个ScrollView.它的一个孩子是ListView.两者都朝同一方向滚动.如何让它们都响应滚动事件?然后当到达ListView的末尾时,事件转到父ScrollView,以便ScrollView可以滚动?
xml布局:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
...
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<LinearLayout
...
android:orientation="vertical"
>
<LinearLayout
android:id="@+id/..."
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0"
android:orientation="horizontal">
...
</LinearLayout>
<android.support.v4.view.ViewPager
.../>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="@dimen/pad_half"
>
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center_vertical"
>
</LinearLayout>
</LinearLayout>
</ScrollView>
Run Code Online (Sandbox Code Playgroud)
我的ListView实际上进入了ViewPager.该设计使得ListView中的大约三个项目可见,并且用户能够滚动以查看其他项目.与此同时,ViewPager上方和下方的视图都是可见的.同样,它是一个ViewPager:它有其他页面而不是ListView.
在java中,HashMap的时间复杂度是getValues().size()多少?它是线性的还是恒定的?我的形象不变,但我不确定.怎么样getValues().get(n)
以下代码打印日期"星期四,2013年10月10日"
Date date = new Date(timeInMilliSec);
SimpleDateFormat df2 = new SimpleDateFormat("EEE, dd MMM yyyy");
String dateText = df2.format(date);
return dateText;
Run Code Online (Sandbox Code Playgroud)
我怎么得到"Thu Oct 21,2013"?