質問

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