UI在渲染时正确,未在设备上显示

拉胡尔·贾(Rahul Jha)

我正在使用Xamarin.Android开发应用程序“ Namaz Pro”!

我的问题是,在将其呈现到Visual Studio中的Device:Nexus 4时,我的应用可以正确显示我期望的UI。

我什至尝试了Android Studio,并且可以根据需要呈现UI:

使成为

但是,KitKat上的My Emulator A Nexus 4无法显示相同的内容:

仿真器显示

更新:我的可绘制文件夹

可绘制文件夹

我的设计规范:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_margin="2dp"
    android:background="#efeff4"
    android:orientation="vertical"
    android:weightSum="100">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="10"
        android:background="#0c3b07"
        android:orientation="vertical">

        <TextView
            android:id="@+id/txtDateToday"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="10"
            android:gravity="center"
            android:text="Thu 05-May-2016"
            android:textColor="#FFFFFF"
            android:textSize="20sp" />

        <TextView
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="10"
            android:gravity="center"
            android:orientation="vertical"
            android:text="28 Rajab 1437"
            android:textColor="#FFFFFF"
            android:textSize="20sp" />
    </LinearLayout>

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="30">

        <ImageView
            android:id="@+id/demoImageView"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:scaleType="fitXY"
            android:src="@drawable/fajrImage" />

        <TextView
            android:id="@+id/txtPrayerNow"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentTop="true"
            android:layout_centerHorizontal="true"
            android:layout_marginTop="12dp"
            android:text="Fajr"
            android:textColor="#FFFFFF"
            android:textSize="20sp" />

        <TextView
            android:id="@+id/txtPrayerTime"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerHorizontal="true"
            android:layout_centerVertical="true"
            android:text="05:30 PM"
            android:textColor="#FFFFFF"
            android:textSize="24sp" />

        <TextView
            android:id="@+id/txtLocation"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"
            android:layout_centerHorizontal="true"
            android:paddingBottom="6dp"
            android:text="Kolkata,India"
            android:textColor="#FFFFFF"
            android:textSize="20sp" />
    </RelativeLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="60"
        android:background="@drawable/background"
        android:orientation="vertical" />
</LinearLayout>
拉胡尔·贾(Rahul Jha)

我的drawable文件夹的文件名中带有连字符和破折号。即使如此,我的项目还是以某种方式建立起来。遵循Xamarin.Android的命名约定

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章