有什么方法可以在横向模式下隐藏字段?基本上,我想要:
android:visibility="GONE"
Run Code Online (Sandbox Code Playgroud)
仅在横向模式下。有可能吗 用一个简单的解决方案...
我尝试了这个:
public override void OnConfigurationChanged(Android.Content.Res.Configuration newConfig)
{
base.OnConfigurationChanged(newConfig);
if(newConfig.Orientation == Android.Content.Res.Orientation.Landscape)
{
// 1
}
else
{
// 2
}
}
Run Code Online (Sandbox Code Playgroud)
但是不起作用。
尝试类似:
if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
View my_view = findViewById(R.id.your_view);
my_view.setVisibility(View.GONE);
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1768 次 |
| 最近记录: |