You need to programmatically set the size of the FrameLayout , width 50 px, height 70px, tried it like this, but the application drops:

 FrameLayout frameLayout=(FrameLayout) findViewById(R.id.frameLayout); frameLayout.setLayoutParams(new FrameLayput.LayoutParams(50,70); 

    1 answer 1

    1) the application always crashes with an error rate. It is very, very, very bad to ask for help without making any effort to solve the problem. If the problem is in error, no one will guess what the error has arisen.
    2) Yes, I still guess. FrameLayout itself is not in FrameLayout 'e, right? That's depending on what it is, and you need to pass a certain type of LayoutParams to setLayoutParams . So, if it is in LinearLayout , then you need to call it like this:
    frameLayout.setLayoutParams(new LinearLayout.LayoutParams(50,70));
    for RelativeLayout :
    frameLayout.setLayoutParams(new RelativeLayout.LayoutParams(50,70));