你好,我有一个应用程序我在快乐Xamarin.Forms工作是获得从Web服务的联系信息,然后显示在标签,但是我想让列出的电话号码拨打电话时,点击该标签该信息.我该怎么做呢?
我的XAML中的继承人:
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="ReadyMo.ContactInfo">
<ContentPage.Content>
<Frame Padding="0,0,0,8" BackgroundColor="#d2d5d7">
<Frame.Content>
<Frame Padding="15,15,15,15" OutlineColor="Gray" BackgroundColor="White">
<Frame.Content>
<ScrollView Orientation="Vertical" VerticalOptions="FillAndExpand">
<StackLayout Padding="20,0,0,0" Orientation="Horizontal" HorizontalOptions="CenterAndExpand">
<StackLayout Orientation="Vertical" VerticalOptions="FillAndExpand">
<Label Text="Emergency Coordinators" HorizontalOptions="Center" FontFamily="OpenSans-Light"
FontSize="20"
TextColor="#69add1">
</Label>
<Label x:Name="CountyName" HorizontalOptions="Center" FontFamily="OpenSans-Light"
FontSize="16"
TextColor="#69add1">
</Label>
<Label x:Name="FirstName" HorizontalOptions="Center">
</Label>
<Label x:Name ="LastName" HorizontalOptions="Center">
</Label>
<Label x:Name="County" HorizontalOptions="Center">
</Label>
<Label x:Name ="Adress" HorizontalOptions="Center">
</Label>
<Label x:Name ="City" HorizontalOptions="Center">
</Label>
//This is the label that displays the phone number!
<Label x:Name="Number" HorizontalOptions="Center"> …Run Code Online (Sandbox Code Playgroud) 你好,我有一个应用程序,我正在从xamrian froms工作,从服务获取数据.我要做的是让名字和姓氏字段显示在同一标签中,但它当前显示名字然后它返回一行,然后显示姓氏.继承我的xaml代码:
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="ReadyMo.ContactInfo">
<ListView ItemsSource="{Binding .}" HasUnevenRows="true">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<Frame Padding="0,0,0,8" BackgroundColor="#d2d5d7">
<Frame.Content>
<Frame Padding="25,25,25,25" OutlineColor="Gray" BackgroundColor="White">
<Frame.Content>
<StackLayout Padding="20,0,0,0" HorizontalOptions="CenterAndExpand" >
<Label x:Name="FirstName" Text="{Binding First_Name}">
</Label>
<Label x:Name ="LastName" Text="{Binding Last_Name}">
</Label>
<Label x:Name="County" Text="{Binding name}">
</Label>
<Label x:Name ="Adress" Text="{Binding Address1}">
</Label>
<Label x:Name ="City" Text="{Binding Address2}">
</Label>
<Label x:Name="Number" Text="{Binding BusinessPhone}" >
</Label>
</StackLayout>
</Frame.Content>
</Frame>
</Frame.Content>
</Frame>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</ContentPage>
Run Code Online (Sandbox Code Playgroud)
编辑这是我的代码隐藏:
using Newtonsoft.Json;
using ReadyMo.Data;
using …Run Code Online (Sandbox Code Playgroud) 我正在开发一个Xamrian Forms中的应用程序,需要从设备获取地理位置数据,然后将地理位置坐标放入forecast.io URL我正在使用James Montemagno的Geolocator插件,我正在使用读取的代码我建议,但是我得到以下错误4次:
当前上下文中不存在名称"Console"
这是我的代码:
using AppName.Data;
using Xamarin.Forms;
using Plugin.Geolocator;
namespace AppName.Radar
{
public partial class RadarHome : ContentPage
{
public RadarHome()
{
var locator = CrossGeolocator.Current;
locator.DesiredAccuracy = 50;
var position = await locator.GetPositionAsync(timeout: 10000);
Console.WriteLine("Position Status: {0}", position.Timestamp);
Console.WriteLine("Position Latitude: {0}", position.Latitude);
Console.WriteLine("Position Longitude: {0}", position.Longitude);
var LatLong = position.Latitude + "," + position.Longitude;
var browser = new WebView();
browser.Source = "https://forecast.io/?mobile=1#/f/" + LatLong;
Content = browser;
}
}
}
Run Code Online (Sandbox Code Playgroud)
我正在使用Visual Studio Update 3.有关我做错的任何想法?
我试图做一个基于卡的ListView在基于断ahaliav狐狸的XAML例子Xamarin形式在这里不过我没有得到什么附近他得到的任何地方我只有一个文本标签,我需要在卡中显示
继承我的xaml代码:
<?xml version="1.0" encoding="UTF-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="WebSearch.CountySelect" BackgroundColor="Gray">
<ListView x:Name="listView">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<Frame Padding="0,0,0,3">
<Frame.Content>
<Frame Padding="15,15,15,15" OutlineColor="Gray" BackgroundColor="White">
<Frame.Content>
<StackLayout Padding="20,0,0,0" Orientation="Horizontal" HorizontalOptions="CenterAndExpand">
<Label Text="{Binding Name}"
FontFamily="OpenSans-Light"
FontSize="9"
TextColor="#69add1"/>
</StackLayout>
</Frame.Content>
</Frame>
</Frame.Content>
</Frame>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</ContentPage>
Run Code Online (Sandbox Code Playgroud)
编辑:我通过使用框架得到ListView项目类似于卡但标签上的文字切断了一半,除非我使文本大小9或更低,以任何方式解决这个错误?
我更新了我的代码以反映我遇到的新问题
任何帮助都会很棒!
嘿家伙我有一个应用程序我正在使用xamarin表单它看起来像这样:

当应用程序加载好友选项卡是第一个选项卡加载我如何使其成为应用程序启动时加载选项卡是第一个选项卡的位置?
继承我的xaml代码:
<?xml version="1.0" encoding="UTF-8"?>
<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:AppName;assembly=AppName"
x:Class="AppName.HomePage">
<TabbedPage.Children>
<NavigationPage x:Name="Friends" Title="Friends" Icon="firendstab.png">
<x:Arguments>
<local:FriendPage />
</x:Arguments>
</NavigationPage >
<NavigationPage x:Name="Snap" Title="Snap" Icon="snaptab.png">>
<x:Arguments>
<local:CameraPage />
</x:Arguments>
</NavigationPage>
<NavigationPage x:Name="Notes" Title="Notes" Icon="notetab.png">
<x:Arguments>
<local:NotePage />
</x:Arguments>
</NavigationPage>
</TabbedPage.Children>
</TabbedPage>
Run Code Online (Sandbox Code Playgroud)
继承了我的代码:
using System;
using System.Collections.Generic;
using Xamarin.Forms;
namespace AppName
{
public partial class HomePage : TabbedPage
{
public HomePage()
{
InitializeComponent();
}
}
}
Run Code Online (Sandbox Code Playgroud)
我过去2天搜索过Google,所以我觉得是时候问了!
提前致谢 :)
您好,我有一个使用Assist API打开的应用,它适用于4.1到5.1.1,但是在android M dev预览中,当我向上滑动主屏幕按钮时,屏幕上显示了卡片,但没有选择该选项我想使用的应用程序如何在我的代码继承人的Java类中解决此问题:
package com.d4a.toolbelt;
import android.app.Activity;
import android.content.ComponentName;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import com.d4a.toolbelt.R;
public class QuickLaunch extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_quick_launch);
}
/** Called when the user clicks the music button */
public void music(View view) {
Intent intent = new Intent("android.intent.action.MUSIC_PLAYER");
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent);
}
/** Called when the user clicks the play button */
public void play(View view) {
Intent launchIntent = …Run Code Online (Sandbox Code Playgroud) 我有两个在android studio中制作的单独的android应用程序项目,我正在尝试将项目1合并到项目2中,以使其全部成为一个应用程序,我该怎么做呢?我知道如何在Eclipse中做到这一点,但在android studio中却不行。请注意,这两个项目都是android应用程序,都不是android库。
任何帮助都将是惊人的!
当我将项目1导入到项目模块中时,在生成成绩时出现此错误:
警告:依赖学校工具Calc lib.gz:SchoolTools:在项目应用程序上未指定将解析为不支持作为编译依赖项的APK存档。文件:/ Users / chrisdebrodie / Documents /学校工具Calc lib.gz / SchoolTools / build / outputs / apk / SchoolTools-release-unsigned.apk
您好我正在开发使用xamarin表单构建的移动应用程序主页面是一个列表视图,其中列出了类别.我需要发生的是当用户点击列表视图中的项目时,它会在应用程序中打开新页面,而下面是xaml代码:
<?xml version="1.0" encoding="UTF-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="SchoolTools.HomePage">
<ListView HasUnevenRows="true">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<Frame Padding="0,0,0,8" BackgroundColor="#d2d5d7">
<Frame.Content>
<Frame Padding="15,15,15,15" OutlineColor="Gray" BackgroundColor="White">
<Frame.Content>
<StackLayout Padding="20,0,0,0" Orientation="Horizontal" HorizontalOptions="CenterAndExpand">
<Label x:Name="Internet" Text="Internet" HorizontalOptions="Center">
</Label>
<Label x:Name ="Math" Text="Math" HorizontalOptions="Center">
</Label>
<Label x:Name="Science" Text="Science" HorizontalOptions="Center">
</Label>
<Label x:Name ="Handwriting" Text="Handwriting" HorizontalOptions="Center">
</Label>
<Label x:Name ="FlashCards" Text="FlashCards" HorizontalOptions="Center">
</Label>
<Label x:Name="Books" Text="Books" HorizontalOptions="Center">
</Label>
</StackLayout>
</Frame.Content>
</Frame>
</Frame.Content>
</Frame>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</ContentPage>
Run Code Online (Sandbox Code Playgroud)
所以我的问题是什么代码beind使数学提交带你到MathToolsHome类?等等等等?
任何帮助都会很棒!
提前一百万!:)
我正在尝试加载一个 html 文件,该文件与我正在使用的类位于同一路径中,当我运行应用程序时,通过 xamarin 表单中的 Web 视图,我得到一个白屏,并且没有加载任何内容,这是我的代码:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
namespace App.Plan
{
public partial class Tornado : ContentPage
{
public Tornado()
{
InitializeComponent();
var browser = new WebView
{
Source = "local.html"
};
}
}
}
Run Code Online (Sandbox Code Playgroud)