-7
A
回答
0
要隱藏你可以使用的知名度選項,imagebutton.setvisibility = View.Invisible();
哪裏ImageButton的是烏爾對象變量
0
首先,你可以得到的對象引用您試圖隱藏圖像按鈕。像這樣的東西 -
ImageButton b = (ImageButton) findViewbyId(R.id.imageButton);
請嘗試以下 -
b.setVisibility(View.INVISIBLE);
這應該使圖像按鈕不可見。爲了使按鈕可見 - b.setVisibility(View.VISIBLE);
0
顯示一個圖像按鈕使用:
yourImageButton.setVisibility(View.VISIBLE);
,並隱藏它使用:
yourImageButton.setVisibility(View.GONE);
0
申報圖片布頓在XML:
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/button_signIn"
android:visibility="invisible"/>
現在得到活動/片段中的refrenece
ImageButton btn;
btn=(ImageButton)findViewById(R.id.button_signIn);
現在瑟根據您的需要
btn.setVisibility(View.VISIBLE);
0
您可以添加選項按鈕絕對佈局的可視性。對於隱形按鈕,您可以使用button.setVisibilty(View.INVISIBLE)
。對於分享按鈕,您可以使用createChooser()
方法。
0
伸出他人的答案。
要顯示您的視圖設置可見性狀態View.VISIBLE
:
yourImageButton.setVisibility(View.VISIBLE);
隱藏它(而按鈕保管空間 - 佈局並沒有改變)設置可見狀態View.INVISIBLE
:
yourImageButton.setVisibility(View.INVISIBLE);
將其完全隱藏(好像它從未添加到父視圖中)使用:
yourImageButton.setVisibility(View.GONE);
相關問題
- 1. 隱藏/顯示圖像按鈕JS
- 2. 如何在html中獲取按鈕以顯示/隱藏圖像?
- 3. 隱藏和顯示按鈕的圖像不工作隨機android
- 4. 如何顯示/隱藏gif圖像,當按鈕點擊在asp.net
- 5. 如何在顯示圖像時隱藏按鈕
- 6. 如何在android中的listview中隱藏和顯示圖像?
- 7. 當按下按鈕時顯示和隱藏動畫圖像
- 8. 在android中顯示隱藏圖像
- 9. 隱藏和顯示圖像
- 10. 通過按鈕或單選按鈕顯示/隱藏圖像
- 11. 在Xcode中隱藏和顯示圖像
- 12. 如何隱藏和顯示Android上的按鈕點擊密碼?
- 13. 使用JavaScript顯示和隱藏下一個按鈕的圖像
- 14. jquery按鈕來顯示/隱藏圖像和文字
- 15. 隱藏和顯示圖像上的按鈕點擊
- 16. Android:在按下按鈕時顯示和隱藏Editext
- 17. 隱藏,顯示,隱藏/ SHOWALL按鈕
- 18. 如何在Android中在畫布上創建按鈕並將該按鈕鏈接到圖像以顯示/隱藏?
- 19. 在Android中的VideoView上顯示和隱藏播放按鈕
- 20. 如何顯示/隱藏按鈕?
- 21. 如何根據條件在grails中顯示和隱藏按鈕?
- 22. 如何根據按鈕點擊隱藏和顯示視圖?
- 23. Docusign顯示/隱藏按鈕
- 24. 顯示/隱藏按鈕
- 25. 顯示/隱藏按鈕javascript
- 26. javascript顯示/隱藏按鈕
- 27. 顯示隱藏按鈕
- 28. 顯示/隱藏按鈕
- 29. sencha隱藏顯示按鈕
- 30. 顯示/隱藏按鈕2