PhysicsLayout ImageView在投入太多时失去了界限

时间:2016-12-09 11:56:39

标签: java android android-layout github

您好

我尝试了<ListView.itemTemplate> <GridLayout rows="*" columns="*"> <Label row="0" col="0" text="right aligned text" textAlignment="right" textWrap="true" /> </GridLayout> </ListView.itemTemplate> GitHubhttps://github.com/Jawnnypoo/PhysicsLayout/),我遇到了这个问题,

当启用投掷并尝试将ImageView抛出屏幕外时,ImageView会脱离界限

这是我的代码

PhysicsLayout

XML

  public class Main extends AppCompatActivity {

    private ImageView ball;  
    PhysicsRelativeLayout physicsLayout;
    private int ballX;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
        setContentView(R.layout.activity_main);

        physicsLayout = (PhysicsRelativeLayout)findViewById(R.id.physics_layout);
        physicsLayout.getPhysics().enablePhysics();

        physicsLayout.getPhysics().enableFling();


        ball = (ImageView)findViewById(R.id.ball);





    }

导致此问题的原因是什么还是可以修复它?

0 个答案:

没有答案