我正在使用Visual Studio 2015开发Windows 10 UWP应用程序.我正在处理后退按钮功能.不幸的是有一个问题.当我按后退按钮(在手机或PC上)时,它不会返回上一页.当我再次按它时,它有效.
就像这个例子:
所以你第一次想要回去它需要两台印刷机......为什么?另外我发现第一次按下不会触发后退按钮事件.但为什么?
我正在使用本文所述的实现:http: //www.wintellect.com/devcenter/jprosise/handling-the-back-button-in-windows-10-uwp-apps
我知道columndefinition在XAML中是如何工作的,但我想做的事情并不知道如何.
我想要4列这样的:
<Grid.ColumnDefinitions>
<ColumnDefinition Width="110" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="80" />
<ColumnDefinition Width="80" />
</Grid.ColumnDefinitions>
Run Code Online (Sandbox Code Playgroud)
第二列包含文本,问题是当该文本太短时,第二列不占用所有可用空间.它会自动变小,每行都会变小.我可以在textblock中使用此代码:
MinWidth="2000"
Run Code Online (Sandbox Code Playgroud)
但这并不是一个好方法,因为当屏幕很大时这个数字可能太低了.
这里包含4列的整个列表视图:
<ListView Grid.Row="1" Grid.ColumnSpan="4" ItemsSource="{Binding blabla}" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch">
<ListView.ItemTemplate>
<DataTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="110" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="80" />
<ColumnDefinition Width="80" />
</Grid.ColumnDefinitions>
<Image Height="110" Width="110" Grid.Column="0" Source="{Binding blabla}" HorizontalAlignment="Stretch" />
<TextBlock Text="{Binding blabla}" TextWrapping="Wrap" Margin="5,0,0,0" Grid.Column="1" FontSize="16" HorizontalAlignment="Stretch" TextAlignment="Left" FlowDirection="LeftToRight" MinWidth="2000" VerticalAlignment="Center" ScrollViewer.HorizontalScrollBarVisibility="Disabled" FontStretch="UltraCondensed"/>
<TextBlock Grid.Column="2" TextWrapping="Wrap" Foreground="Black" Margin="5,0,0,0" HorizontalAlignment="Stretch" VerticalAlignment="Center"/>
<Image Source="{Binding blabla, …
Run Code Online (Sandbox Code Playgroud) 我的服务器正在向请求发送带有正文的示例响应标头:
static char* not_found_response_template =
"HTTP/1.1 404 Not Found\n"
"Content-type: text/html\n"
"\n"
"<html>\n"
" <body>\n"
" <h1>Not Found</h1>\n"
" <p>The requested URL was not found on this server.</p>\n"
" </body>\n"
"</html>\n";
len = strlen(not_found_response_template);
send(newSct, not_found_response_template, len, 0);
Run Code Online (Sandbox Code Playgroud)
它正确发送它,但firefox继续加载,直到我取消传输.
firefox插件HttpRequestHelper显示了这个:
获取localhost:6666
- 响应 - 404未找到内容类型:text/html
为什么内容没有加载?
随着getIndex xs y
我希望第一个子表的索引,xs
其长度大于y
.
输出是:
[[],[4],[4,3],[3,5,3],[3,5,5,6,1]]
aufgabe6: <<loop>>
Run Code Online (Sandbox Code Playgroud)
为什么getIndex
不起作用?
import Data.List
-- Die Sortierfunktion --
myCompare a b
| length a < length b = LT
| otherwise = GT
sortList :: [[a]] -> [[a]]
sortList x = sortBy myCompare x
-- Die Indexfunktion --
getIndex :: [[a]] -> Int -> Int
getIndex [] y = 0
getIndex (x:xs) y
| length x <= y = 1 + getIndex xs y
| otherwise …
Run Code Online (Sandbox Code Playgroud)