我需要这样的事情:
LinearLayout(修复)
- 按钮
的LinearLayout
- ScrollView
- TextView
- TextView
- TextView
我希望修复第一个LinearLayout(如标题)。当有人试图向下滚动时,我希望TextView在修复LinearLayout后面。我希望该按钮始终可见。使用此代码,所有内容都向下滚动。 这是我的代码:
ScrollView scrollView = (ScrollView) findViewById(R.id.scrollView);
final LinearLayout linearLayout = new LinearLayout(this);
linearLayout.setOrientation(linearLayout.VERTICAL);
scrollView.addView(linearLayout);
final LinearLayout topLinearLayout = new LinearLayout(this);
topLinearLayout.setOrientation(topLinearLayout.VERTICAL);
linearLayout.addView(topLinearLayout);
final Button button = new Button(this);
button.setText(R.string.button);
topLinearLayout.addView(button);
TextView title = new TextView(this);
title.setText(R.string.title);
title.setGravity(Gravity.CENTER);
linearLayout.addView(title);
答案 0 :(得分:0)
您要将$(document).ready(function(){
$('.whyus').animate({right: "+=500px",}, 5000 );
});
添加到topLinearLayout
中,并在linearLayout
中添加scrollView
。这不是你想要的。
在另一个scrollView
topLinearLayout
和LinearLayout
final LinearLayout mainlinearLayout = new LinearLayout(this);
mainlinearLayout.setOrientation(linearLayout.VERTICAL);
ScrollView scrollView = (ScrollView) findViewById(R.id.scrollView);
final LinearLayout topLinearLayout = new LinearLayout(this);
topLinearLayout.setOrientation(topLinearLayout.VERTICAL);
mainlinearLayout.addView(topLinearLayout);
mainlinearLayout.addView(scrollView);
final LinearLayout linearLayout = new LinearLayout(this);
linearLayout.setOrientation(linearLayout.VERTICAL);
scrollView.addView(linearLayout);
final Button button = new Button(this);
button.setText(R.string.button);
topLinearLayout.addView(button);
TextView title = new TextView(this);
title.setText(R.string.title);
title.setGravity(Gravity.CENTER);
linearLayout.addView(title);