要使用d3.js绘制弧线,我们需要使用函数
d3.arc()
.innerRadius(..)
.outerRadius(..)
...
Run Code Online (Sandbox Code Playgroud)
这使从A点到B再回到A的路径。我应如何使用从A到B绘制简单弧线?最后,这将是定义为startAngle,endAngle和radius的行
我在ScrollView(SV)中有父RelativeLayout(RL ).在父RL中我有一个孩子也是RL.我想将另一个子RL添加到父RL并向下滚动屏幕高度
RelativeLayout.LayoutParams lparams = new RelativeLayout.LayoutParams(this.width,
this.height);
lparams.addRule(RelativeLayout.BELOW, first_child.getId());
new_layout.setLayoutParams(lparams);
rl.addView(new_layout);
int current_pos = sv.getScrollY();
sv.smoothScrollTo(0,current_pos + this.height);
Run Code Online (Sandbox Code Playgroud)
新的子RL已成功添加到父级,但smootScrollTo方法无法正常工作.就像addView()方法是异步工作一样,当方法smoothScrollTo调用时,父RL还没有包含新的子RL.
如何在父母中添加新的子RL并立即向下滚动屏幕?