多次更改ViewStub布局

时间:2018-09-30 12:58:07

标签: android layout viewstub

我有一个tickPositions tickPositioner 和一个CIM_Datafile。 我试图按导航按钮时更改视图。为此,我使用了strComputer = "." filePath="C:\\Program Files\\Windows Media Player\\wmplayer.exe" Set objWMI = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") Set colFiles=objWMI.ExecQuery("Select * from CIM_Datafile Where Name = '"& filePath &"'") For Each objFile in colFiles WScript.Echo " FileName: " & objFile.FileName & vbCrlf & _ " 8.3 Name: " & objFile.EightDotThreeFileName & vbCrlf & _ " Drive: " & objFile.Drive & vbCrlf & _ " Extension: " & objFile.Extension & vbCrlf & _ " FileType: " & objFile.FileType & vbCrlf & _ " Path: " & objFile.Path & vbCrlf & _ " InUse Counter: " & objFile.InUseCount & vbCrlf & _ " Creation Date: " & objFile.CreationDate & vbCrlf & _ " Last Accessed: " & objFile.LastAccessed & vbCrlf & _ " Last Modified: " & objFile.LastModified & vbCrlf & _ " Archive: " & objFile.Archive & vbCrlf & _ " Compressed: " & objFile.Compressed & vbCrlf & _ " Encrypted: " & objFile.Encrypted & vbCrlf & _ " System: " & objFile.System & vbCrlf & _ " Writeable: " & objFile.Writeable & vbCrlf & _ " Hidden: " & objFile.Hidden Next ,然后根据按下的按钮,选择了不同的布局。

问题是,此方法第一次起作用。但是,当我单击另一个按钮并尝试设置另一个布局时,我得到了:

ConstrainedLayout

我相信这是因为ViewStub不再存在。

那么我如何多次更改此布局?我需要跟踪当前布局并用新布局替换吗?

这是我的XML:

BottomNavigation

这是我设置布局的方式:

ViewStub

0 个答案:

没有答案