尝试在我的项目中使用最新的appcompat-v7支持库时,出现以下错误:
/Users/greg/dev/mobile/android_project/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/21.0.0/res/values-v11/values.xml
Error:(36, 21) No resource found that matches the given name: attr 'android:actionModeShareDrawable'.
Error:(36, 21) No resource found that matches the given name: attr 'android:actionModeShareDrawable'.
Error:(36, 21) No resource found that matches the given name: attr 'android:actionModeShareDrawable'.
Error:(36, 21) No resource found that matches the given name: attr 'android:actionModeShareDrawable'.
Run Code Online (Sandbox Code Playgroud)
我该如何解决?
android gradle xamarin.android android-support-library android-5.0-lollipop
尝试将我的应用部署到Android设备时,我收到以下错误:
Deployment failed because of an internal error: Failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE]
Run Code Online (Sandbox Code Playgroud)
我知道这个问题,但没有安装该应用程序.在尝试部署期间,Visual Studio已将其删除/部分删除.
在过去,我通过从Google Play商店下载应用程序然后从设置 - >应用程序管理器中删除它来解决此问题.但是,现在我在尝试安装它时收到错误"不兼容的更新".
我尝试使用Titanium Backup删除它,但其他一些东西却没有运气.
编辑1
我意识到(来自@Motz)我没有提到明显的解决方案不起作用.即,该应用程序不会出现在设置 - >应用程序中
我在Android.App中找不到找到FragmentPagerAdapter.
我不想使用Android.Support.V4.App中的Fragment,因为我的目标API是14及更高版本(Android 4.0及更高版本).所以,我想使用Android.App.Fragments的平原,以及相关的类.
我只在Android.Support.V4.App中找到它,但这对我来说不够b/c我正在尝试使用Android.App.Fragment(而不是Android.Support.V4.App.Fragment)并且那里Android.App(不是Android.Support.V4.App)中的相关类,如果我从FragmentPagerAdapter派生我的寻呼机(如果它来自支持库),我的代码将无法编译,因为Android.App和Android.Support之间的类型不匹配.V4.App.
就像这里的情况一样无法强制转换为android.app.Fragment,是否有一个"普通"的寻呼机(PagerAdapter)类我应该用它代替FragmentPagerAdapter或其他东西(就像你从普通的Activity派生而来,而不是FragmentActivity,在针对API 11或更高版本时).
下面是我正在使用的示例代码(它来自于https://github.com/xamarin/monodroid-samples/tree/master/Support4上的MonoDroid示例的Support4.sln解决方案中的FragmentPagerSupport.cs文件).
我已经注释掉引用Android.Support.V4.App的行,并用引用Android.App的代码替换它们.我找不到Android.Support.V4.App之外没有FramePagerAdapter,我真的需要它.
谢谢.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Android.App;
using Android.Content;
using Android.OS;
using Android.Runtime;
using Android.Views;
using Android.Widget;
//using Android.Support.V4.App;
//using Android.Support.V4.View;
namespace Support4
{
[Activity (Label = "@string/fragment_pager_support")]
[IntentFilter (new[]{Intent.ActionMain}, Categories = new[]{ "mono.support4demo.sample" })]
//public class FragmentPagerSupport : FragmentActivity
public class FragmentPagerSupport : Activity
{
const int NUM_ITEMS = 10;
MyAdapter adapter;
ViewPager pager;
protected override void OnCreate (Bundle bundle)
{ …Run Code Online (Sandbox Code Playgroud) android xamarin.android android-fragments fragmentpageradapter
我需要在Xamarin.Forms与Xamarin本机应用程序之间做出选择.
我想使用Xamarin.Forms,因为UI代码也将被共享.
那么与Native相比,Xamarin.Forms有什么缺点.
我有
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid
android:color="#FFFF00" />
<padding android:left="7dp"
android:top="7dp"
android:right="7dp"
android:bottom="7dp" />
</shape>
<TextView
android:background="@drawable/test"
android:layout_height="45dp"
android:layout_width="100dp"
android:text="Moderate"
/>
Run Code Online (Sandbox Code Playgroud)
所以现在我希望这个形状根据我从Web服务调用中获取的信息来改变颜色.所以它可能是黄色或绿色或红色或其他任何取决于我从网络电话呼叫收到的颜色.
如何更改形状的颜色?根据这些信息?
我正在尝试在Visual Studio 2017 (社区版)中构建我的第一个F#Android项目.
在使用F# - Android - Blank App模板创建新项目后,Visual Studio中的错误窗口立即显示以下消息:
项目Foo缺少构建所需的Android SDK.双击此消息,然后按照提示进行安装.
双击该消息不会导致提示出现.
我找不到从以下位置下载Android SDK的明显位置:
我记得很久以前的SDK管理器似乎已经从Android开发者网站上消失了.
我已经安装了Android Studio,它似乎下载了一些Android SDK,但Visual Studio似乎仍无法找到它想要的东西.
android visual-studio xamarin.android android-sdk-tools xamarin
我正在尝试使用自己的布局创建一个DialogFragment.
我见过几种不同的方法.有时布局在OnCreateDialog中设置如下:(我正在使用Mono,但我已经习惯了Java)
public override Android.App.Dialog OnCreateDialog (Bundle savedInstanceState)
{
base.OnCreateDialog(savedInstanceState);
AlertDialog.Builder b = new AlertDialog.Builder(Activity);
//blah blah blah
LayoutInflater i = Activity.LayoutInflater;
b.SetView(i.Inflate(Resource.Layout.frag_SelectCase, null));
return b.Create();
}
Run Code Online (Sandbox Code Playgroud)
第一种方法对我有用......直到我想findViewByID.
在谷歌搜索后使用,我尝试了第二种方法,涉及覆盖OnCreateView
所以我注释掉了两行OnCreateDialog设置布局然后添加了这个:
public override Android.Views.View OnCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
View v = inflater.Inflate(Resource.Layout.frag_SelectCase, container, false);
//should be able to use FindViewByID here...
return v;
}
Run Code Online (Sandbox Code Playgroud)
这给了我一个可爱的错误:
11-05 22:00:05.381: E/AndroidRuntime(342): FATAL EXCEPTION: main
11-05 22:00:05.381: E/AndroidRuntime(342): android.util.AndroidRuntimeException: requestFeature() must be called before adding content
Run Code Online (Sandbox Code Playgroud)
我很难过.
java.lang.OutOfMemoryError.考虑增加$(JavaMaximumHeapSize)的值.Java执行'java.exe'时内存不足
我在visualstudio Xamarin项目中出现内存异常请帮助我如何解决此问题.
我正在寻找一种方法来以编程方式包含布局,而不是include像我的示例中那样使用XML标记 :
<include layout="@layout/message"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.75"/>
Run Code Online (Sandbox Code Playgroud)
需要以编程方式更改此参数" layout ="@ layout/message ".
知道怎么做吗?
我在Xamarin.Forms.ContentPage有线到按钮点击事件中有以下方法
public class LoginPage : ContentPage
{
private Button _loginButton = null;
private Entry _PasswordInput = null;
private Entry _UsernameInput = null;
public LoginPage()
{
_UsernameInput = new Entry { Placeholder = "Username" };
_PasswordInput = new Entry { Placeholder = "Password", IsPassword = true };
_loginButton = new Button
{
Text = "Login",
BorderRadius = 5
}
_loginButton.Clicked += LogIn;
Content = new StackLayout
{
VerticalOptions = LayoutOptions.Center,
Children =
{
_UsernameInput, _PasswordInput, _loginButton,
},
Spacing = …Run Code Online (Sandbox Code Playgroud) xamarin.android ×10
android ×7
xamarin ×5
c# ×2
gradle ×1
include ×1
java ×1
mono ×1
navigation ×1
parameters ×1
shape ×1
xamarin.ios ×1