【发布时间】:2017-06-11 22:10:49
【问题描述】:
这里是xml代码:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:id="@+id/activity_main"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.example.himanshu.staticlogin.MainActivity"
android:weightSum="1">
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
card_view:cardBackgroundColor="@color/cardview_dark_background"
card_view:cardElevation="10dp"
android:clickable="true"
/>
</LinearLayout>
它在预览中显示高度,但当我运行文件时它没有。我做错了什么?
【问题讨论】:
-
您使用的是什么版本的设备?
-
我最近在 SDK 的 v23 上遇到并解决了同样的问题。如果您显示清单文件的应用程序标签,那么我可能会给您解决方案。
标签: java android xml eclipse android-studio