小编Loc*_* Le的帖子

如何让UITabBar选择指标图像填满整个空间?

我有一个UITabBarController,我使用此代码来设置选择指标图像:

let selectedBG = UIImage(named:"tabbarbgtest.png")?.resizableImageWithCapInsets(UIEdgeInsetsMake(0, 0, 0, 0))
UITabBar.appearance().selectionIndicatorImage = selectedBG
Run Code Online (Sandbox Code Playgroud)

但是图像并没有填满整个空间 - 见下图:

在此输入图像描述

图像只是一个红色正方形,在82x49px上有一个解决方案,但是如果图像更宽,它仍然无法填满整个空间.希望你们能帮忙 - 谢谢.

uitabbarcontroller uiimage ios swift

12
推荐指数
3
解决办法
9832
查看次数

Azure 应用注册客户端机密过期

Microsoft 是否将客户端机密的到期日期更改为最长 2 年?不能再选择“从不”了吗?

azure secret-key azure-active-directory

10
推荐指数
2
解决办法
5980
查看次数

如何在UIButton的右边缘对齐UIButton图像

如何将图像对齐到UIButton的右边缘,因此它将保留在所有设备的右边缘.下图显示了带有图像的UIButton(圆三角形).图像是来自iPhone 6的屏幕截图,它符合我的要求.但是对于iPhone 6+,图像向左移动一点点,对于iPhone 5,它向右移动,图像显示在外面.的UIButton.我知道这个的原因,这是因为我将UIEdgeInsets的左边设置为300,这非常适合iPhone 6.所以我的问题是如何才能为所有iPhone设置这种外观.谢谢.

在此输入图像描述

我的UIButton代码:

class DropDownButton : UIButton{

    required init(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)!
        style()
    }

    private func style() {
        self.titleEdgeInsets.left = 0
        self.layer.cornerRadius = 2;
        self.setImage(UIImage(named: "Arrow_Close"), forState: UIControlState.Normal)
        self.imageEdgeInsets = UIEdgeInsets(top: 0, left: 300, bottom: 0, right: 0)
        self.backgroundColor = UIColor(CGColor: "#FFFFFF".CGColor)
        self.tintColor = UIColor(CGColor: "#616366".CGColor)
        self.titleLabel!.font = UIFont(name: "OpenSans", size: 15)



    }
}
Run Code Online (Sandbox Code Playgroud)

uibutton uiimage swift xcode7

8
推荐指数
1
解决办法
3929
查看次数

Html图表不适合小型Android WebView

我有一个WebView,其宽度和高度为25dp.在这个小的WebView中,我想从Chart.js中显示一个圆形图,但它没有调整大小以适应我创建的小WebView.

圆形图的HTML:

<!doctype html>
<html>
    <head>
        <script src="chart.min.js"></script>
        <style>
            html, body
        {
            height: 100%;
        }
    </style>
</head>
<body>
    <canvas id="myChart" style="width:100%; height:80%;"></canvas>      

    <script>

        var chartData = [
  dataprotein,
  datafat,
  datacarb
];

        var data = {
        datasets: [{
                borderWidth: 0,
                data: chartData,
                    backgroundColor: [
                        '#FF604E',
                        '#4666FF',
                        '#47CC6F',
                    ]

            }],

        };

        var ctx = document.getElementById('myChart').getContext('2d');
        var chart = new Chart(ctx, {
            // The type of chart we want to create
            type: 'pie',

            // The data for our dataset
            data: data
        });

    </script> …
Run Code Online (Sandbox Code Playgroud)

html css android android-webview chart.js

8
推荐指数
1
解决办法
374
查看次数

WPF应用程序不要求防火墙获得许可

我正在创建一个WPF应用程序,我使用WebCLient从Web服务器下载文件.当我在调试模式下启动我的应用程序时,它要求防火墙获得权限,然后我允许它,这使我的应用程序正常工作.

但在发布模式下,它不会提示我使用防火墙权限,这会导致我的应用程序在下载文件时崩溃.我在发布模式下部署我的应用程序.当我运行.exe部署后获得的文件时,它仍然不会要求防火墙权限,这会使我的应用程序无法正常工作.

有没有办法在发布模式下以编程方式触发防火墙提示?

c# wpf firewall release windows-firewall

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

如何在Inno Setup中创建两个LicenseFile页面

我正在为我的应用程序设置Inno.我正在使用此命令:

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"; LicenseFile: "C:\Users\LocDaiLe\Desktop\license.txt"
Run Code Online (Sandbox Code Playgroud)

显示许可协议窗口,但我希望彼此之后有两个许可协议窗口.我怎么能这样做 - 谢谢

licensing inno-setup

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

如何在 UIAlertController 中更改一种 UIAlertAction 文本颜色

如何更改 UIAlertController 中的一个 UIAlertAction 而不是所有操作按钮的文本颜色。

这是我的 UIAlertController 代码:我想将删除 UIAlertAction 文本颜色更改为红色。

//Alert to select more method
func moreAlert()
{           
    let optionMenu = UIAlertController(title: "Mere", message: "", preferredStyle: UIAlertControllerStyle.ActionSheet)

    let Edit = UIAlertAction(title: "Rediger", style: .Default, handler: { action in

    })


    let Delete = UIAlertAction(title: "Slet", style: .Default, handler: { action in

    })

    let cancelAction = UIAlertAction(title: "Annullere", style: .Cancel, handler: { action in        
        print("Cancelled")
    })

    optionMenu.addAction(Edit)            
    optionMenu.addAction(Delete)            
    optionMenu.addAction(cancelAction)


    self.presentViewController(optionMenu, animated: true, completion: nil)
}
Run Code Online (Sandbox Code Playgroud)

swift uialertcontroller uialertaction xcode7

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

使用WebClient下载文件异步不起作用

我正在使用C#在VS15中创建一个控制台应用程序.这是我的下载课程:

class DownloadGamefile
{
    public  void DownloadFile(string address, string location)
    {
        WebClient client = new WebClient();
        Uri Uri = new Uri(address);

        client.DownloadFileCompleted += new AsyncCompletedEventHandler(Completed);

        client.DownloadProgressChanged += new DownloadProgressChangedEventHandler(DownloadProgress);
        client.DownloadFileAsync(Uri, location);

    }

    private void DownloadProgress(object sender, DownloadProgressChangedEventArgs e)
    {
        // Displays the operation identifier, and the transfer progress.
        Console.WriteLine("{0}    downloaded {1} of {2} bytes. {3} % complete...",
            (string)e.UserState,
            e.BytesReceived,
            e.TotalBytesToReceive,
            e.ProgressPercentage);
    }

    private void Completed(object sender, AsyncCompletedEventArgs e)
    {
        if (e.Cancelled == true)
        {
            Console.WriteLine("Download has been canceled.");
        }
        else …
Run Code Online (Sandbox Code Playgroud)

c# asynchronous webclient download

3
推荐指数
1
解决办法
1万
查看次数

如何始终将 PopUp 放在 WPF 中的 ToggleButton 下

当我点击它时,我想在切换按钮下放置一个弹出窗口。在这个弹出窗口中,我想添加按钮和其他控件。但是,当我调整我的 mian 窗口大小时,如何确保弹出窗口始终位于我的切换按钮下方。

我的 XAML 代码:

     <ToggleButton
    x:Name="userBtn"
    Margin="610,25,378,0"
    VerticalAlignment="Top"            
    Height="29"
    Grid.Column="2" 
    >
        <ToggleButton.Resources>
            <BitmapImage x:Key="imgNormal" UriSource="/Resources/home.jpg"/>
            <BitmapImage x:Key="imgHover" UriSource="/Resources/home_checked.jpg"/>
            <BitmapImage x:Key="imgChecked" UriSource="/Resources/home_checked.jpg"/>
        </ToggleButton.Resources>
        <ToggleButton.Style>
            <Style TargetType="ToggleButton">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="ToggleButton" >
                            <StackPanel Orientation="Horizontal" VerticalAlignment="Top" Width="150" Height="32">
                                <Image x:Name="PART_Image" Height="22" Width="22" RenderOptions.BitmapScalingMode="HighQuality" HorizontalAlignment="Center" Margin="0,0,0,0" Source="{StaticResource imgNormal}"/>
                                <TextBlock x:Name="PART_TEXT" FontFamily="Arial" Foreground="#FFAFADAD" FontSize="13" HorizontalAlignment="Center" Text="{x:Static properties:Resources.BtnDashboard}"  Margin="10,9,0,0"></TextBlock>
                            </StackPanel>
                            <ControlTemplate.Triggers>
                                <Trigger Property="IsChecked" Value="true">
                                    <Setter TargetName="PART_Image" Property="Source" Value="{StaticResource imgChecked}"/>
                                    <Setter TargetName="PART_TEXT" Property="Foreground" Value="#79B539" />
                                </Trigger>
                                <Trigger Property="IsMouseOver" Value="true">
                                    <Setter TargetName="PART_Image" Property="Source" Value="{StaticResource imgHover}"/> …
Run Code Online (Sandbox Code Playgroud)

c# wpf popup togglebutton

3
推荐指数
1
解决办法
2716
查看次数

角度路由在 firebase 托管中不起作用

我有一个 Angular 项目,其中路由在 localhost 中工作,但是当我将项目部署到托管的 Firebase 时,仅 base-url 有效。这是我的路由:示例https://baseurl/jegharaldrigkategori在 Firbase 托管中不起作用。它说“找不到页面”

  const routes: Routes = [
  {
      path: '',
      redirectTo: 'home', 
      pathMatch: 'full'
  },
  {
    path: 'home', 
    component: HomeComponent
  },
  {
    path: 'jegharaldrigkategori', 
    component: JegharaldrigkategoriComponent
  },
  {
    path: 'jegharaldrig', 
    component: JegharaldrigComponent
  },
  {
    path: 'udfordring', 
    component: UdfordringComponent
  },
  {
    path: 'terning', 
    component: TerningComponent
  },
  {
    path: 'overunder', 
    component: OverunderComponent
  }
];
Run Code Online (Sandbox Code Playgroud)

firebase typescript angular-routing firebase-hosting angular

3
推荐指数
1
解决办法
2319
查看次数