fill-parent

Android Listview width prob

自作多情 提交于 2020-01-07 08:09:23
问题 Here is the main layout for a screen: <?xml version="1.0" encoding="utf-8"?> <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/splashContent" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@drawable/splashscreenbg"> <TableRow android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight=".008" android:gravity="center" android:background="@drawable

Android fill_parent to match_parent

纵然是瞬间 提交于 2020-01-03 08:14:30
问题 What was the reason behind introducing match_parent and deprecating fill_parent since both mean the same thing. won't this change be a hindrance to backward compatibility? 回答1: Using match_parent instead of fill_parent will NOT make the generated APK unrunnable in older versions because in the generated APK the occurrence of match_parent's and fill_parent's will be replaced with their corresponding Constant Value, which is same in this case (both are -1), so same APK can run on older versions

fill_parent is not filling entire screen in LinearLayout

被刻印的时光 ゝ 提交于 2019-12-31 02:44:09
问题 I tried to search for this answer and the closest I got to an answer was to add android:resizable="true", which is deprecated. I apologize if this question has been answered but I couldn't find it if it was. Anyway, my app is not filling the entire screen. The method I was using was working in android 2.2 but I am now using a 2.3 emulator and it's not working. I am not sure if this is actually the issue or not. Now to the problem... I am creating a temperature converter app (yes, it's

ImageView in a Custom Dialog - fill_parent does not work and my dialog is small

♀尐吖头ヾ 提交于 2019-12-23 16:01:34
问题 I have a simple request: I have to put some pictures (some small resolution, some big resolution) in a dialog and display them fullscreen. I tried this: Dialog dialog = new Dialog(getActivity()); dialog.setContentView(R.layout.custom_dialog); int picId = Integer.valueOf(webcamCursor.getString(webcamCursor .getColumnIndex("_id"))); dialog.setTitle(webcamCursor.getString(webcamCursor .getColumnIndex("City"))); image = (ImageView) dialog.findViewById(R.id.image); image.setImageResource(R

Android 3 - Adding a Fragment to a LinearLayout: fill_parent does not work

三世轮回 提交于 2019-12-18 04:36:11
问题 I am trying to add a fragment programmatically to a LinearLayout, but the fragment does not stretch its content across the whole layouts height. It acts like wrap_content instead of fill_parent. On the other side the fill_parent works on the fragment's width. How can I change this behaviour? DashboardActivity: <?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"

Child of RelativeLayout is not filling the height of the RelativeLayout

微笑、不失礼 提交于 2019-12-03 19:51:27
问题 I have a ListView which gets populated with RelativeLayouts. The content of these RelativeLayouts can change and thus change their height respectively. On each RelativeLayout, I have a little vertical bar on the left side of the layout that matches the height of the layout. It's a similar look to this -> Link Though for some reason, the View object that I'm using isn't expanding to the height of the layout. What am I doing wrong? <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns

Set AdMob banner to match parent width by XML

不羁岁月 提交于 2019-12-03 16:17:17
问题 I'm trying to set AdMob banner ad to match it's parent width. I tried as sample: <com.google.ads.AdView android:id="@+id/ad" android:layout_width="match_parent" android:layout_height="50dp" android:gravity="center" ads:adSize="BANNER" ads:adUnitId="app-pub-id" ads:loadAdOnCreate="true"/> And got: I also tried with: ads:adSize="SMART_BANNER" In the IDE xml preview, I got: But in fact the ad didn't match his parent width. Anyone? 回答1: The right way to set AdMob banner to match his parent by XML

Scaling an image to max available width, keeping aspect ratio and avoiding ImageView extra space

匆匆过客 提交于 2019-12-03 08:50:21
问题 I have this simple layout XML, and a green_square.png file which is 30X30 pixels <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <ImageView android:background="@color/red" android:layout_width="fill_parent" android:layout_height="fill_parent" android:adjustViewBounds="true" android:scaleType="fitStart" android:src="@drawable

Set AdMob banner to match parent width by XML

人走茶凉 提交于 2019-12-03 05:30:25
I'm trying to set AdMob banner ad to match it's parent width. I tried as sample: <com.google.ads.AdView android:id="@+id/ad" android:layout_width="match_parent" android:layout_height="50dp" android:gravity="center" ads:adSize="BANNER" ads:adUnitId="app-pub-id" ads:loadAdOnCreate="true"/> And got: I also tried with: ads:adSize="SMART_BANNER" In the IDE xml preview, I got: But in fact the ad didn't match his parent width. Anyone? The right way to set AdMob banner to match his parent by XML is: <com.google.ads.AdView android:id="@+id/ad" android:layout_width="wrap_content" android:layout_height=

fill_parent is not filling entire screen in LinearLayout

我只是一个虾纸丫 提交于 2019-12-02 02:45:47
I tried to search for this answer and the closest I got to an answer was to add android:resizable="true", which is deprecated. I apologize if this question has been answered but I couldn't find it if it was. Anyway, my app is not filling the entire screen. The method I was using was working in android 2.2 but I am now using a 2.3 emulator and it's not working. I am not sure if this is actually the issue or not. Now to the problem... I am creating a temperature converter app (yes, it's homework) and the app is not filling the entire screen even though I say fill_parent for the layout_width and