android-framelayout

Overlay text over imageview in framelayout programmatically - Android

假如想象 提交于 2019-12-18 08:40:55
问题 I am trying to implement a textview over an image in a framelayout at the center and bottom of the layout as it is seen here: http://developer.android.com/resources/articles/layout-tricks-merge.html <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent"> <ImageView android:layout_width="fill_parent" android:layout_height="fill_parent" android:scaleType="center" android:src="@drawable/golden_gate" />

Overlay text over imageview in framelayout programmatically - Android

我是研究僧i 提交于 2019-12-18 08:40:03
问题 I am trying to implement a textview over an image in a framelayout at the center and bottom of the layout as it is seen here: http://developer.android.com/resources/articles/layout-tricks-merge.html <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent"> <ImageView android:layout_width="fill_parent" android:layout_height="fill_parent" android:scaleType="center" android:src="@drawable/golden_gate" />

Trying to add a fragment to my fragment container FrameLayout

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-18 05:28:06
问题 I have created an xml file called editor.xml which contains a FrameLayout. In my main activity I am trying to add my custom fragment to my FrameLayout. The error I receive when trying to add my fragment is: The method add(int, Fragment) in the type FragmentTransaction is not applicable for the arguments (int, editorFrag) However my editorFrag extends Fragment so I am confused on why this is happening. Below is my code for the files I have mentioned. Any help is appreciated. Editor.xml <?xml

Android: Set margins in a FrameLayout programmatically- not working

落爺英雄遲暮 提交于 2019-12-18 03:15:09
问题 here is the code- FrameLayout.LayoutParams params = (FrameLayout.LayoutParams) searchPin.getLayoutParams(); params.setMargins(135, 176, 0, 0); //params.leftMargin = 135; // also not worked //params.topMargin = 376; searchPin.setLayoutParams(params); Where ever, from xml its working- android:layout_marginLeft="135dp" what can be the reason? am i missing something! -thnx 回答1: Try this: params.gravity = Gravity.TOP; 回答2: I had a FrameLayout child of a RelativeLayout so the framework was trying

Android child view height not match parent in ListView item

别等时光非礼了梦想. 提交于 2019-12-18 02:42:40
问题 As described, my List item is a FrameLayout , there are two views inside. ColorView is a custom view I made for show color in whole view. ( FrameLayout 's height is "wrap_content") It seems work well on my ICS device, but doesn't work on my Android 2.2 emulator and Android 1.6 G1. <?xml version="1.0" encoding="utf-8"?> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content"> <org.mariotaku.twidere.view

how to use correct dragging of a view on android

时间秒杀一切 提交于 2019-12-17 18:44:24
问题 it seems that there are a lot of solutions of how to use dragging of views on android . however, they are either too slow or buggy. a known solution is to have a framelayout , and the view simply changes its layoutParams as it moves using the OnTouchListener ,as described here: http://www.anddev.org/novice-tutorials-f8/android-drag-and-drop-of-normal-views-not-bitmaps-t13404.html however, if the view is an imageView , when reaching the most right (or most bottom) side of the framelayout , the

Get Fragment dynamically attached to <FrameLayout>?

≯℡__Kan透↙ 提交于 2019-12-17 17:48:06
问题 Well, i got a simple <FrameLayout> : <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/FragmentContainer" android:layout_width="fill_parent" android:layout_height="fill_parent" /> Then in my code, i added a Fragment to it: FragClass aFrag = new FragClass(); getSupportFragmentManager().beginTransaction() .replace(R.id.FragmentContainer, aFrag).commit(); And somewhere else in my code, i want to get that FragClass (extends Fragment) object from the ID R.id

Why is a FrameLayout used for fragments?

荒凉一梦 提交于 2019-12-17 10:44:17
问题 Wherever I look, FrameLayout seems to be used as the FragmentContainer . Why is FrameLayout always seen with Fragments ? 回答1: You can basically use RelativeLayout or LinearLayout it will still work,but the answer of your question is in FrameLayout 's documentation : FrameLayout is designed to block out an area on the screen to display a single item. Generally, FrameLayout should be used to hold a single child view, because it can be difficult to organize child views in a way that's scalable

addView not visible in custom FrameLayout but clickable

馋奶兔 提交于 2019-12-13 15:51:01
问题 I wanted to create a relatively generic ViewGroup container to have it switch to a progressbar and hide it again (+switch to content) when the loading task is ready. This should be easy to use and fit for most (not all) cases. I know this might have been asked several times, but I could not find a fitting solutions after working on this for 4-5 hours. What does not work? The progressbar simply does not show up at all. I tried it with Visibility and removing / adding all the views in several

How to show the image outside the dialog in android?

我是研究僧i 提交于 2019-12-12 22:32:18
问题 I trying to show the profile image in topside of the dialog fragment with half outside the image.and i attach the sample dialog in below, like that.And tried all FrameLayout collaboration from old Stackoverflow solutions, But i cant able to archive this. Please give me correct solution. Thankyou. Updated I also tried to make transparent the ImageView parent layout but it's not working in after dialog show. i attach my xml and result screen shot below. <RelativeLayout xmlns:android="http:/