문제

Hello In my android application i want to set visibility for the text view . I am having 3 text-views and 3 check-boxes in application. i want to set visibility of text-views by checking check-boxes, i am using "setVisibility()". it is working also but problem is when i dont check check-box for text-view1 at that time it shows blank and keeps space for text-view one and then it shows text-view2 & 3. I don't want to show this blank space for text-view1. I want to show the text-view from top which i select from check-boxes.. is there any way to do this ?? Thank you.

도움이 되었습니까?

해결책

You might be using View.INVISIBLE. However, you need to use use View.GONE in order to remove that space.

yourEditText.setVisibility(View.GONE);

다른 팁

Setting the visibility to INVISIBLE leaves space for the component. Setting the visibility to GONE should remove the space

http://developer.android.com/reference/android/view/View.html#GONE

Initially Set the visibility to Gone in XML, Use Oncheck Listener & Change the SetVisibility to SetVisibility(Visible). & You can also change the Visibility by setting the visibility from int Visibility(8) to visibility (0);

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top