android: layout_width = "fill_parent"
android: layout_height = "wrap_content">
android: layout_width = "fill_parent"
android: layout_height = "wrap_content"
android: onClick = "showDanCiMessage"
android: src = "@ drawable / logo_gray" />
android: layout_width = "fill_parent"
android: layout_height = "fill_parent"
android: orientation = "vertical" android: visibility = "gone">
android: layout_width = "wrap_content"
android: layout_height = "wrap_content"
android: text = "Chinese"
android: textAppearance = "android:? attr / textAppearanceLarge"
android: textColor = "@ color / line_qianHui"
/>
android: layout_width = "wrap_content"
android: layout_height = "wrap_content"
android: text = "English sentence"
android: textAppearance = "android:? attr / textAppearanceLarge"
android: textColor = "@ color / line_qianHui"
/>
android: layout_width = "wrap_content"
android: layout_height = "wrap_content"
android: text = "Chinese interpretation"
android: textAppearance = "android:? attr / textAppearanceLarge"
android: textColor = "@ color / selectTextColor"
/>
The need to achieve the above functions is to click the picture, and then the picture hidden inside the LinearLayout layout of all the things that show up
public void showDanCiMessage (View v1) {
ImageView iv = (ImageView) v1.findViewById (R.id.imageView_logio_a);
iv.setVisibility (View.GONE) ;/ / Image can hide
View v = LayoutInflater.from (this). Inflate (R.layout.layout_fuxidanci,
null);
LinearLayout lLay = (LinearLayout) v
. FindViewById (R.id.LinearLayout_jieShi_lay);
lLay.setVisibility (View.INVISIBLE) ;/ / here do not show up, but do not mistake
Have a look
<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
lLay.setVisibility (View.INVISIBLE) ;/ / View.VISIBLE it
Also how can you not directly LinearLayout lLay = (LinearLayout) v1 findViewById (R.id.LinearLayout_jieShi_lay);.
Reply:
I'll try to wait
Reply:
lLay.setVisibility (View.VISIBLE); this does not work, and before the same
Continue solving
Reply:
1st Floor positive solution.
View.INVISIBLE is a view not visible, but still take up space.
View.GONE is a view not visible, and does not take up space.
View.VISIBLE view is visible.
Reply:
public void showDanCiMessage (View v1) {
ImageView iv = (ImageView) v1.findViewById (R.id.imageView_logio_a);
iv.setVisibility (View.GONE) ;/ / picture can hide, no problem
View v = LayoutInflater.from (this). Inflate (R.layout.layout_fuxidanci,
null) ;/ / get layout_fuxidanci.xml layout file
LinearLayout lLay = (LinearLayout) v
. FindViewById (R.id.LinearLayout_jieShi_lay) ;/ / get layout object
lLay.setVisibility (View.VISIBLE) ;/ / here do not show up, but do not mistake
}
Why
Reply:
lLay defined as global.
In onCreate in obtaining lLay = (LinearLayout) findViewById (R.id.LinearLayout_jieShi_lay);
Then showDanCiMessage set hidden.
Reply:

Reply:
How to solve? I am also the interface does not show up, but the state obtained is 0
No comments:
Post a Comment