我正在尝试动画到我的listview。动画是使用翻译动画推送列表视图。这工作正常,但在动画结束时,底行被切断。我猜这是因为在执行动画时没有加载底行。知道如何克服这个问题吗?有没有办法让列表视图以编程方式加载另一行?
@Override
protected void onCreate(Bundle savedInstanceState)
{
init();
initAnimation();
mCannedMessageAdapter = new UIUListAdapter(mCannedItems);
ListView listView = (ListView) findViewById(R.id.lv_canned_messages);
listView.setAdapter(mCannedMessageAdapter);
listView.setOnItemClickListener(new OnItemClickListener()
{
mActionButton = (Button) findViewById(R.id.btn_action);
mActionButton.setOnClickListener(new OnClickListener()
{
@Override
public void onClick(View v)
{
toggleEditMode();
}
});
mActionButton.setText("Edit");
}
private void toggleEditMode()
{
if (mActionButton.getText().equals("Edit"))
{
view.startAnimation(mPushUpAnim);
mCompleteLayout.startAnimation(mPushUpAnim);
mActionButton.setText("Done");
}
else
{
mActionButton.setText("Edit");
}
mCannedMessageAdapter.toggleEditMode();
}
动画
<translate
android:duration="1000"
android:fromYDelta="0"
android:toYDelta="-15%p" />