小编Bil*_*ldr的帖子

让我们解决"当前主题中找不到风格'mapViewstyle'的错误"

很抱歉发布另外一个,但似乎我们还没有记录这个问题的每个解决方案.

这是发生了什么:我添加了mapview,一切都在工作.我添加了一个滑动抽屉并将按钮移入其中,然后将根节点从线性更改为相对.从那时起,我在读取的main.xml类的图形布局中出现错误

缺少风格.是否为此布局选择了正确的主题?使用布局上方的主题组合框选择不同的布局,或修复主题样式引用.无法在当前主题中找到样式'mapViewStyle'.

将根节点切换为线性并返回到相对位置已使地图显示,但错误仍在图形布局中.

到目前为止,我已经完成了以下解决方案,可以解决大多数情况下的问题:

  1. 添加了style.xml以创建"mapView"样式.
  2. 验证我的构建目标是API 2.3.3(10)
  3. 确保<uses-library android:name="com.google.android.maps"/>是Application的子节点.
  4. 清理/重建我的应用程序.
  5. 删除了R.
  6. 删除并重建了main.xml
  7. 重新启动了adb服务器,Eclipse,我的计算机和我的设备.
  8. 在图形布局中,在Android 3.0和Android 2.3.3之间切换.

但是,我的问题仍然存在.这是我的布局xml.

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/RelativeLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >


<com.google.android.maps.MapView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/mapview"
    style="@style/mapView"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:layout_alignParentBottom="true"
    android:layout_alignParentLeft="true"
    android:layout_alignParentTop="true"
    android:apiKey="asdf" //not my real key
    android:clickable="true" />

<!-- TODO: update the API key with release signature -->
<SlidingDrawer
    android:id="@+id/slidingDrawer1"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:content="@+id/content"
    android:handle="@+id/handle" >

    <Button
        android:id="@+id/handle"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/Menu" />


    <LinearLayout
        android:id="@+id/content"
        android:layout_width="match_parent"
        android:layout_height="match_parent" >

        <Button
            android:id="@+id/about"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:text="@string/about" /> …
Run Code Online (Sandbox Code Playgroud)

eclipse android android-layout android-mapview

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

使用Azure的MSBuild - PublishProfileSet计算为""

我正在尝试将我的项目部署到Azure.我一直在Azure上用EF代码摔跤几个小时,但是我得到它去了一次它创建了一个用户.我去发布更新,现在我收到以下错误:

Invoke build failed due to exception 'Expected "$(_PublishProfileSet)" to evaluate to a boolean instead of "", in condition "$(_PublishProfileSet) And '$(PublishProfileName)' =='' And '$(WebPublishProfileFile)'==''".

我删除了发布配置文件并对其进行了读取,我还从Azure中检索了一个新的配置文件.这个问题不断涌现.我无法在任何地方找到我的解决方案中的PublishProfileSet,而且我不确定它应该去哪里或应该设置为什么.关于如何从中恢复的任何想法?

c# msbuild azure web-deployment asp.net-mvc-4

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

如何通过HttpClient PostAsync方法将文件和参数上传到远程服务器?

我正在尝试将文件从桌面应用程序上传到远程服务器.浏览SO一段时间后,这种方法似乎是最简洁的方法.问题是服务器端没有接收到参数.我错过了什么?

    private void AddFile(FileInfo fileInfo, int folderId)
    {
        using (var handler = new HttpClientHandler() {CookieContainer = _cookies})
        {
            using (var client = new HttpClient(handler) {BaseAddress = new Uri(_host)})
            {
                var requestContent = new MultipartFormDataContent();
                var fileContent = new StreamContent(fileInfo.Open(FileMode.Open));
                var folderContent = new StringContent(folderId.ToString(CultureInfo.InvariantCulture));
                requestContent.Add(fileContent, "file", "file");
                requestContent.Add(folderContent, "folderId", "folderId");

                client.PostAsync("/Company/AddFile", requestContent);
            }
        }
    }
Run Code Online (Sandbox Code Playgroud)

编辑:这是服务器端期望的签名:

    [HttpPost]
    public ActionResult AddFile(HttpPostedFileBase file, int folderId)
Run Code Online (Sandbox Code Playgroud)

c#

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

为什么我没有看到错误消息?

多年来我第一次感受到我的感觉.我正在尝试执行一个简单的select语句.我已经确认该语句直接针对mysql.我的PHP没有完成.我想知道为什么我的real_query不工作,我也想知道如何从这种情况中哄骗错误信息.这是代码:

function getRoot($nid)
{
    echo $nid; //displays 0
    try 
    {
        echo "Hello?"; //This displays

        //Why doesn't this work?!
        if($mysqli->real_query("SELECT * FROM gem, bundles WHERE gem.nid = bundles.baseNid AND bundles.nid = " . $nid))
        {
            echo "dafuq?"; //does not display
        }
        else
        {
            echo "foo"; //doesn't display
            echo $mysqli->error; //doesn't display
        }
    }
    catch (Exception $e)
    {
        echo "Tralalalala"; //doesn't display
    }
    echo "teeheehee"; //doesn't display
}
Run Code Online (Sandbox Code Playgroud)

谢谢你的帮助!

php

0
推荐指数
1
解决办法
71
查看次数