我正在尝试在 StackLayout 内页面的右下角添加一个浮动按钮
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:fab="clr-namespace:FAB.Forms;assembly=FAB.Forms"
x:Class="Hura.Pages.LatestNews"
Title="Latest news">
<StackLayout Spacing="10" Padding="5">
<Label Text="Latest news" FontSize="Medium"/>
<ListView x:Name="lsvNews"/>
<Label Text="Latest activities" FontSize="Medium"/>
<ListView x:Name="lsvActivities"/>
<Label Text="Good Mording" FontSize="Large" HorizontalOptions="Center"/>
<AbsoluteLayout x:Name="xyz"
BackgroundColor="Transparent"
HorizontalOptions="End"
VerticalOptions="End">
<Button Text="gggggg"/>
</AbsoluteLayout>
</StackLayout>
</ContentPage>
Run Code Online (Sandbox Code Playgroud)
但按钮出现在标签下方。但我希望它出现在标签上方而不是下方。
如何将按钮定位在标签上方的左下角?
我正在尝试使用POST
方法将字典内容发送到服务器
public async Task<T> postConnection(string GETParam, Dictionary<string, string> values, bool isRegistration = false)
{
HttpResponseMessage response;
string responseString;
try
{
using (var client = new HttpClient() { MaxResponseContentBufferSize = 256000 })
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", tocken);
var content = new FormUrlEncodedContent(values);
response = await client.PostAsync(url, content);
responseString = await response.Content.ReadAsStringAsync();
}
}
Run Code Online (Sandbox Code Playgroud)
但是当我运行代码时,它给了我错误
WebException: The request requires buffering data to succeed HttpClient
.
我不想使用WebRequest
或请求WebClient
,我只想使用HttpClient
.
一个问题已经存在,当尝试发送一个head request
说只是在Xamarin …
我正在研究从Facebook安卓应用程序嗅探数据包.我想在社交网络上研究用户行为时使用嗅探数据.
我在过去两个月学到的是我必须创建一个vpn服务并用它来嗅探数据.互联网上有很多有用的代码,我试图理解和运行.我设法使用这些代码嗅探某些应用程序的数据,这些代码都使用相同的概念.
当使用上述代码中的每一个,并进行少量修改时,我设法捕获所有应用程序的数据包,但是对于像facebook这样的应用程序,vpnService使这些应用程序停止工作; 当我创建vpn服务并尝试评论帖子或进行任何需要在Facebook应用程序和Facebook服务器之间发送/接收数据的操作时,此操作不会发生; 看起来不知何故Facebook应用程序知道有人在嗅他.
在过去的两个月里,我一直在尝试在不破坏Facebook应用程序功能的情况下找到捕获Facebook应用程序包的方法.
我尝试在Android示例中按照KeyChain演示安装证书,但它不适用于我.
从我的搜索中,我知道/我确信有一些我缺少的东西; 我搜索的应用程序做了我想要完成的事情,而没有像facebook那样的应用程序检测它.我在Google Play上找到了LostNetNoRootFirewall.
使用LostNetNoRootFirewall,我设法创建了一个vpn服务并嗅探数据包,而facebook应用程序就像一个魅力!
我应该向我的应用程序添加什么才能创建一个vpnService并阻止像facebook这样的应用程序检测到我的服务正在嗅探它的数据包?
package com.git.firewall;
public class GITVpnService extends VpnService implements Handler.Callback, Runnable {
private static final String TAG = "GITVpnService";
private String mServerAddress = "127.0.0.1";
private int mServerPort = 55555;
private PendingIntent mConfigureIntent;
private Handler mHandler;
private Thread mThread;
private ParcelFileDescriptor mInterface;
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
// The handler is …
Run Code Online (Sandbox Code Playgroud) 我有一个对象数组,包含每个"actionButton"id,选择器和回调
var actionButtons = [
{
id:"0",
selector:"._55ln._qhr",
callback: undefined
},
{
id:"1",
selector:"._22aq._jhr",
callback: undefined
},
.
.
.
];
Run Code Online (Sandbox Code Playgroud)
我想要做的是每次单击选择器时,使用数组中的特定参数(id)调用函数.
for(var i=0;i<actionButtons.length;i++){
$(document).on('click', actionButtons[i].selector, function() {
makeAction(actionButtons[i].id);
if (actionButtons[i].callback)
actionButtons[i].callback(this);
});
}
Run Code Online (Sandbox Code Playgroud)
但是这段代码不起作用; 看起来每次调用回调函数时,其值i
都等于数组大小.
我怎样才能解决这个问题;即 使i
每个回调变量的值变得不同.
我试图通过X
从上到下旋转位置来创建一个出现悬停的div ,我还想为它的旋转添加一些逼真的(DIV从底部的宽度应始终为100%,但应逐渐增加从20%到100%白色它旋转).
.img-event-parent{
position: relative;
}
.img-event-details{
position: absolute;
background-color: rgba(0,0,0,0.8);
left: 0px;
right: 0px;
top: 0px;
height: 100%;
transform: rotateX(90deg);
transform-style: preserve-3d;
-webkit-transform: rotateX(90deg);
transform-origin: bottom;
transition: all 3s;
}
.img-event-parent:hover .img-event-details{
transform: rotateX(0deg);
}
Run Code Online (Sandbox Code Playgroud)
<div class="img-event">
<div class="img-event-parent img-parent">
<a href="#">
<img src="https://images.pexels.com/photos/20787/pexels-photo.jpg?auto=compress&cs=tinysrgb&h=350" alt="">
</a>
<div class="img-event-details">
<a href="#" class="slick-desc"><?=$key->post_title?></a>
</div>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
上面的片段旋转img-event-details
div,但我不知道如何在旋转时从顶部仅调整div宽度(如上图所示).
我正在使用flutter_bloc库。我的屏幕小部件代码看起来像这样:
class RegisterScreen extends StatefulWidget {
RegisterScreen();
@override
_RegisterScreenState createState() => _RegisterScreenState();
}
class _RegisterScreenState extends State<RegisterScreen> {
@override
Widget build(BuildContext context) {
return BlocProvider<RegisterBloc>(
create: (BuildContext context) {
// RegisterBloc.get(context).add(RegisterGetCitiesEvent());<=== This gives me error `BlocProvider.of() called with a context that does not contain a Cubit of type RegisterBloc. \n No ancestor could be found starting from the context that was passed to BlocProvider.of<RegisterBloc>().`
return RegisterBloc();
},
child: BlocConsumer<RegisterBloc, RegisterState>(
listener: (BuildContext context, RegisterState state) {},
builder: (BuildContext …
Run Code Online (Sandbox Code Playgroud) 我在我的 flutter 应用程序中添加了不同的库。我正在应用程序中实现一项功能,每当错误或消息从任何库或错误消息打印到控制台时,我想将该错误或消息字符串发送到服务器。
如何以编程方式监听 flutter 中的控制台,以便每当将字符串打印到控制台时我都可以捕获它以便稍后将其发送到服务器?
我正在尝试在设备的内存中获取存储的数字,并使用该方法将其解析为整数Integer.parseInt
.
win:function(){
this.reset();
if(Integer.parseInt(window.localStorage.getItem("curLevel"))<this.levelNo)
{
window.localStorage.setItem("curLevel", this.levelNo+1);
renderAllLevels();
}
$.mobile.pageContainer.pagecontainer("change", "#winlevel");
}
Run Code Online (Sandbox Code Playgroud)
但是当win
调用该函数时,我收到了错误Uncaught ReferenceError: Integer is not defined
.
我Integer.parseInt
在我的项目的其他行中使用它并没有任何错误.
在这里使用它有什么潜在的错误?