小编XHo*_*erX的帖子

Windows 10 UWP应用程序 - 返回按钮仅在第二次按下时有效

我正在使用Visual Studio 2015开发Windows 10 UWP应用程序.我正在处理后退按钮功能.不幸的是有一个问题.当我按后退按钮(在手机或PC上)时,它不会返回上一页.当我再次按它时,它有效.

就像这个例子:

  1. 启动应用程序(第1页)
  2. 转到第2页
  3. 转到第3页
  4. 点击后退按钮(没有任何反应)
  5. 单击后退按钮(转到第2页)
  6. 单击后退按钮(转到第1页)

所以你第一次想要回去它需要两台印刷机......为什么?另外我发现第一次按下不会触发后退按钮事件.但为什么?

我正在使用本文所述的实现:http: //www.wintellect.com/devcenter/jprosise/handling-the-back-button-in-windows-10-uwp-apps

windows button back universal

14
推荐指数
1
解决办法
873
查看次数

XAML Columndefinitions width*不占用可用空间

我知道columndefinition在XAML中是如何工作的,但我想做的事情并不知道如何.

我想要4列这样的:

<Grid.ColumnDefinitions>
    <ColumnDefinition Width="110" />
    <ColumnDefinition Width="*" />
    <ColumnDefinition Width="80" />
    <ColumnDefinition Width="80" />
</Grid.ColumnDefinitions>
Run Code Online (Sandbox Code Playgroud)
  1. 列具有固定宽度
  2. 列必须占用所有可用空间(是的,它是在列之间,这正是问题)
  3. 列具有固定宽度
  4. 列具有固定宽度

第二列包含文本,问题是当该文本太短时,第二列不占用所有可用空间.它会自动变小,每行都会变小.我可以在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)

xaml column-width

5
推荐指数
1
解决办法
2532
查看次数

C中的简单HTTP服务器 - 如何响应浏览器?

我的服务器正在向请求发送带有正文的示例响应标头:

    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

为什么内容没有加载?

c networking http response

4
推荐指数
1
解决办法
3585
查看次数

Haskell << loop >>

随着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)

sorting indexing haskell loops list

2
推荐指数
1
解决办法
318
查看次数

标签 统计

back ×1

button ×1

c ×1

column-width ×1

haskell ×1

http ×1

indexing ×1

list ×1

loops ×1

networking ×1

response ×1

sorting ×1

universal ×1

windows ×1

xaml ×1