android-framelayout

Android: when / why should I use FrameLayout instead of Fragment?

徘徊边缘 提交于 2019-11-26 22:43:14
问题 I am building a layout for large screens, that is supposed to consist of 2 different parts, a left one and a right one. For doing that I thought using 2 Fragments is the right choice. Then I had a look on the example of the navigation with the Master/Detail-Flow . It has a 2-pane layout, where on the right is the navigation, and on the left is the detail view. But in that example, different from what I expected to see, for the detail view there is a FrameLayout that then holds a Fragment ,

How to disable behind view click event Framelayout

痞子三分冷 提交于 2019-11-26 19:33:20
问题 Here i have one view pager activity which has one imageview and 2 overlay bars. there overlay bars i made using android xml file layout itself. Here my requirement is like that 1) single tap on view pager's imageview first time = show top and bottom rectangle overlaybar. 2) single tap on view pager's imageview second time = hide these overlays. These both are functions like android gallary view type. But here when these top and bottom layout bar displays at that time i want to use only

Full screen background image in an activity

孤人 提交于 2019-11-26 19:14:31
I see many applications that use a full-screen image as background. This is an example: I want to use this in a project, the best way I've found so far to do this is to use an image with a large size, put it in a ImageView and use android: adjustViewBounds="true" to adjust the margins The problem is that if a screen with a very high resolution, the image falls short. Another option I thought of is to use the image in a FrameLayout , with match_parent in width and height as background... this stretches the image, but I think the result is not very good. How would you do it? stinepike There are

Button always displays on top in FrameLayout

徘徊边缘 提交于 2019-11-26 18:14:57
问题 I have FrameLayout like this: <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:onClick="changeColor" android:text="new button"/> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="some text"/> </FrameLayout> The problem is that the button is displayed on top while

How to set foreground attribute to other non FrameLayout view

雨燕双飞 提交于 2019-11-26 18:07:46
问题 I would like to know how to apply or emulate foreground effect in a view different from FrameLayout, as LinearLayout or RelativeLayout This is what I have now: <?xml version="1.0" encoding="utf-8"?> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/cardContent" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/row_background" android:foreground="

What are the differences between LinearLayout, RelativeLayout, and AbsoluteLayout?

空扰寡人 提交于 2019-11-26 16:54:51
I am confused about the difference between LinearLayout, RelativeLayout, and AbsoluteLayout. Could someone please tell me the exact differences between them? LinearLayout means you can align views one by one (vertically/ horizontally). RelativeLayout means based on relation of views from its parents and other views. ConstraintLayout is similar to a RelativeLayout in that it uses relations to position and size widgets, but has additional flexibility and is easier to use in the Layout Editor. WebView to load html, static or dynamic pages. FrameLayout to load child one above another, like cards

ClassCastException android.widget.FrameLayout$LayoutParams to android.support.v4.widget.DrawerLayout$LayoutParams

删除回忆录丶 提交于 2019-11-26 16:04:41
问题 I'm working on the Navigation Drawer for Android. As per my requirement I was to display gridview and listview of items in the navigation drawer. I have created a linearLayout in the layout xml file and placed the two widgets(Grid view, and Listview) in the LinearLayout. When I run the file I'm getting the following error: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.navigationdrawer3/com.example.navigationdrawer3.MainActivity}: java.lang.ClassCastException:

Convert frame layout into image and save it [closed]

泄露秘密 提交于 2019-11-26 14:22:29
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 5 years ago . can any one please help me to know how to capture contents of a FrameLayout into an image and save it to internal or external storage. 回答1: try this to convert a view (framelayout) into a bitmap: public Bitmap viewToBitmap(View view) { Bitmap bitmap = Bitmap.createBitmap(view.getWidth(), view

getHeight returns 0 for all Android UI objects

百般思念 提交于 2019-11-26 11:50:00
I'm building a UI, and it's all static defined in the XML. All of it has weights all over the place, and while it looks right, I wanted to see that things actually have the right height and all. The problem is that no matter where I call .getHeight() for my format layout I got 0. I tried in both onCreate() and onStart(). Same thing. Happens for all UI objects too. Any idea? package com.app.conekta; import android.app.Activity; import android.os.Bundle; import android.util.Log; import android.view.Window; import android.widget.Button; import android.widget.FrameLayout; import android.widget

Android YouTubePlayer with unauthorized overlay on top of player

删除回忆录丶 提交于 2019-11-26 11:26:31
问题 I\'m using YouTubePlayer (YouTube api for android) within a Fragment I am inflating a LinearLayout with the YouTube Player, in this way: fragmentManager = getActivity().getSupportFragmentManager(); fragmentTransaction = fragmentManager.beginTransaction(); player = new YouTubePlayerSupportFragment(); fragmentTransaction.add(R.id.youTubePlayerContainer, player); fragmentTransaction.commit(); ...Where youTubePlayerContainer is the inflated LinearLayout The player is detected correctly, start